From 2374e85dc7ebc4ed3b53047e5159346ede9abdb5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 14 Jun 2021 22:25:31 +0300 Subject: [PATCH] Add std_interop_test7 --- test/CMakeLists.txt | 1 + test/Jamfile.v2 | 1 + test/std_interop_test7.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 test/std_interop_test7.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 36d5dd0..7d77452 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -95,3 +95,4 @@ boost_test(TYPE run SOURCES std_interop_test3.cpp) boost_test(TYPE run SOURCES std_interop_test4.cpp) boost_test(TYPE run SOURCES std_interop_test5.cpp) boost_test(TYPE run SOURCES std_interop_test6.cpp) +boost_test(TYPE run SOURCES std_interop_test7.cpp) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 73ce321..92bbae6 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -105,3 +105,4 @@ run std_interop_test5.cpp ; run std_interop_test6.cpp ; +run std_interop_test7.cpp ; diff --git a/test/std_interop_test7.cpp b/test/std_interop_test7.cpp new file mode 100644 index 0000000..7d0820b --- /dev/null +++ b/test/std_interop_test7.cpp @@ -0,0 +1,38 @@ +// Copyright 2021 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include +#include + +#if !defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR) + +BOOST_PRAGMA_MESSAGE( "BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined, test will be skipped" ) +int main() {} + +#else + +#include + +int main() +{ + { + boost::system::error_code e1 = make_error_code( boost::system::errc::bad_address ); + + BOOST_TEST( e1 == std::errc::bad_address ); + BOOST_TEST_NOT( e1 != std::errc::bad_address ); + } + + { + boost::system::error_code e1 = make_error_code( std::errc::bad_address ); + + BOOST_TEST( e1 == std::errc::bad_address ); + BOOST_TEST_NOT( e1 != std::errc::bad_address ); + } + + return boost::report_errors(); +} + +#endif