Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / vmd / test / test_is_empty.cxx
index af23d49..af815a1 100644 (file)
@@ -1,11 +1,12 @@
 
-//  (C) Copyright Edward Diener 2011-2015
+//  (C) Copyright Edward Diener 2011-2015,2019
 //  Use, modification and distribution are subject to the Boost Software License,
 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 //  http://www.boost.org/LICENSE_1_0.txt).
 
 #include <boost/vmd/is_empty.hpp>
 #include <boost/preprocessor/facilities/empty.hpp>
+#include <boost/preprocessor/variadic/has_opt.hpp>
 #include <boost/detail/lightweight_test.hpp>
 
 int main()
@@ -30,7 +31,27 @@ int main()
   #define FUNC_GEN3() anything
   #define FUNC_GEN4(x) anything
   
-#if BOOST_VMD_MSVC
+#if BOOST_PP_VARIADIC_HAS_OPT()
+
+  #define FUNC_GEN5(x,y) ()
+  #define FUNC_GEN6(x,y) anything
+  #define FUNC_GEN7() (y,z)
+  #define FUNC_GEN5A() (&)
+  #define FUNC_GEN6A(x) (y)
+  #define FUNC_GEN7A() (y,z)
+  
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN));
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN2));
+  
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN5));
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN6));
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN7));
+
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN5A));
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN6A));
+  BOOST_TEST(!BOOST_VMD_IS_EMPTY(FUNC_GEN7A));
+  
+#elif BOOST_VMD_MSVC
 
   #define FUNC_GEN5(x,y) ()
   #define FUNC_GEN6(x,y) anything