1 | |
---|---|
2 | // Copyright 2018 Peter Dimov. |
3 | // Distributed under the Boost Software License, Version 1.0. |
4 | |
5 | #include <boost/system/error_code.hpp> |
6 | #include <boost/core/lightweight_test.hpp> |
7 | #include <boost/core/quick_exit.hpp> |
8 | #include <boost/config.hpp> |
9 | #include <cerrno> |
10 | |
11 | #if defined(BOOST_MSVC) |
12 | # pragma warning(disable: 4722) // Z::~Z never returns |
13 | #endif |
14 | |
15 | using namespace boost::system; |
16 | |
17 | struct Z |
18 | { |
19 | ~Z() |
20 | { |
21 | BOOST_TEST_CSTR_EQ( generic_category().name(), "generic"); |
22 | BOOST_TEST_CSTR_EQ( system_category().name(), "system"); |
23 | |
24 | boost::quick_exit( code: boost::report_errors() ); |
25 | } |
26 | }; |
27 | |
28 | static Z z; |
29 | |
30 | static error_code e1( 1, system_category() ); |
31 | static error_code e2( ENOENT, generic_category() ); |
32 | |
33 | int main() |
34 | { |
35 | (void)e1; |
36 | (void)e2; |
37 | } |
38 |