1// Copyright 2021 Peter Dimov.
2// Distributed under the Boost Software License, Version 1.0.
3// http://www.boost.org/LICENSE_1_0.txt
4
5#include <boost/system/error_code.hpp>
6#include <boost/core/lightweight_test.hpp>
7#include <boost/config/pragma_message.hpp>
8#include <boost/config.hpp>
9#include <ios>
10
11#if defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000
12
13BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_LIBSTDCXX_VERSION < 50000" )
14int main() {}
15
16#else
17
18#include <system_error>
19
20int main()
21{
22 {
23 boost::system::error_code ec = std::io_errc::stream;
24
25 BOOST_TEST( ec == std::io_errc::stream );
26 BOOST_TEST_NOT( ec != std::io_errc::stream );
27
28 ec.clear();
29
30 BOOST_TEST_NOT( ec == std::io_errc::stream );
31 BOOST_TEST( ec != std::io_errc::stream );
32
33 ec = std::io_errc::stream;
34
35 BOOST_TEST( ec == std::io_errc::stream );
36 BOOST_TEST_NOT( ec != std::io_errc::stream );
37 }
38
39 return boost::report_errors();
40}
41
42#endif
43

source code of boost/libs/system/test/std_interop_test11.cpp