]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/system/test/std_interop_test11.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / system / test / std_interop_test11.cpp
diff --git a/ceph/src/boost/libs/system/test/std_interop_test11.cpp b/ceph/src/boost/libs/system/test/std_interop_test11.cpp
new file mode 100644 (file)
index 0000000..8374e1a
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright 2021 Peter Dimov.
+// Distributed under the Boost Software License, Version 1.0.
+// http://www.boost.org/LICENSE_1_0.txt
+
+#include <boost/system/error_code.hpp>
+#include <boost/core/lightweight_test.hpp>
+#include <boost/config/pragma_message.hpp>
+#include <boost/config.hpp>
+#include <ios>
+
+#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
+
+BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined" )
+int main() {}
+
+#elif defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000
+
+BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_LIBSTDCXX_VERSION < 50000" )
+int main() {}
+
+#else
+
+#include <system_error>
+
+int main()
+{
+    {
+        boost::system::error_code ec = std::io_errc::stream;
+
+        BOOST_TEST( ec == std::io_errc::stream );
+        BOOST_TEST_NOT( ec != std::io_errc::stream );
+
+        ec.clear();
+
+        BOOST_TEST_NOT( ec == std::io_errc::stream );
+        BOOST_TEST( ec != std::io_errc::stream );
+
+        ec = std::io_errc::stream;
+
+        BOOST_TEST( ec == std::io_errc::stream );
+        BOOST_TEST_NOT( ec != std::io_errc::stream );
+    }
+
+    return boost::report_errors();
+}
+
+#endif