]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
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_SYSTEM_HAS_SYSTEM_ERROR) | |
12 | ||
13 | BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_SYSTEM_HAS_SYSTEM_ERROR not defined" ) | |
14 | int main() {} | |
15 | ||
16 | #elif defined(BOOST_LIBSTDCXX_VERSION) && BOOST_LIBSTDCXX_VERSION < 50000 | |
17 | ||
18 | BOOST_PRAGMA_MESSAGE( "Skipping test, BOOST_LIBSTDCXX_VERSION < 50000" ) | |
19 | int main() {} | |
20 | ||
21 | #else | |
22 | ||
23 | #include <system_error> | |
24 | ||
25 | int main() | |
26 | { | |
27 | { | |
28 | boost::system::error_code ec = std::io_errc::stream; | |
29 | ||
30 | BOOST_TEST( ec == std::io_errc::stream ); | |
31 | BOOST_TEST_NOT( ec != std::io_errc::stream ); | |
32 | ||
33 | ec.clear(); | |
34 | ||
35 | BOOST_TEST_NOT( ec == std::io_errc::stream ); | |
36 | BOOST_TEST( ec != std::io_errc::stream ); | |
37 | ||
38 | ec = std::io_errc::stream; | |
39 | ||
40 | BOOST_TEST( ec == std::io_errc::stream ); | |
41 | BOOST_TEST_NOT( ec != std::io_errc::stream ); | |
42 | } | |
43 | ||
44 | return boost::report_errors(); | |
45 | } | |
46 | ||
47 | #endif |