| 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 <cerrno> |
| 8 | |
| 9 | using namespace boost::system; |
| 10 | |
| 11 | static error_code e1( 1, system_category() ); |
| 12 | static std::string m1 = e1.message(); |
| 13 | |
| 14 | static error_code e2( ENOENT, generic_category() ); |
| 15 | static std::string m2 = e2.message(); |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | error_code e1_( 1, system_category() ); |
| 20 | |
| 21 | BOOST_TEST_EQ( e1, e1_ ); |
| 22 | BOOST_TEST_EQ( m1, e1_.message() ); |
| 23 | |
| 24 | error_code e2_( ENOENT, generic_category() ); |
| 25 | |
| 26 | BOOST_TEST_EQ( e2, e2_ ); |
| 27 | BOOST_TEST_EQ( m2, e2_.message() ); |
| 28 | |
| 29 | return boost::report_errors(); |
| 30 | } |
| 31 |
