]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/describe/test/pp_is_empty_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / describe / test / pp_is_empty_test.cpp
diff --git a/ceph/src/boost/libs/describe/test/pp_is_empty_test.cpp b/ceph/src/boost/libs/describe/test/pp_is_empty_test.cpp
new file mode 100644 (file)
index 0000000..09a35fc
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright 2021 Peter Dimov
+// Distributed under the Boost Software License, Version 1.0.
+// https://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/describe/detail/pp_utilities.hpp>
+#include <boost/describe/detail/config.hpp>
+#include <boost/core/lightweight_test.hpp>
+
+#if !defined(BOOST_DESCRIBE_CXX11)
+
+#include <boost/config/pragma_message.hpp>
+
+BOOST_PRAGMA_MESSAGE("Skipping test because C++11 is not available")
+int main() {}
+
+#else
+
+#define S(x) S2(x)
+#define S2(x) #x
+
+#if defined(_MSC_VER)
+# pragma warning(disable: 4003) // not enough arguments for macro invocation
+#endif
+
+char const * s1 = S(BOOST_DESCRIBE_PP_IS_EMPTY());
+char const * s2 = S(BOOST_DESCRIBE_PP_IS_EMPTY(x));
+char const * s3 = S(BOOST_DESCRIBE_PP_IS_EMPTY(() x));
+char const * s4 = S(BOOST_DESCRIBE_PP_IS_EMPTY((a, b) x));
+
+int main()
+{
+    BOOST_TEST_CSTR_EQ( s1, "1" );
+    BOOST_TEST_CSTR_EQ( s2, "0" );
+    BOOST_TEST_CSTR_EQ( s3, "0" );
+    BOOST_TEST_CSTR_EQ( s4, "0" );
+
+    return boost::report_errors();
+}
+
+#endif // !defined(BOOST_DESCRIBE_CXX11)