| 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 | |
| 8 | using namespace boost::system; |
| 9 | |
| 10 | namespace lib1 |
| 11 | { |
| 12 | |
| 13 | error_code get_system_code(); |
| 14 | error_code get_generic_code(); |
| 15 | |
| 16 | } // namespace lib1 |
| 17 | |
| 18 | namespace lib2 |
| 19 | { |
| 20 | |
| 21 | error_code get_system_code(); |
| 22 | error_code get_generic_code(); |
| 23 | |
| 24 | } // namespace lib2 |
| 25 | |
| 26 | int main() |
| 27 | { |
| 28 | { |
| 29 | error_code e1 = lib1::get_system_code(); |
| 30 | error_code e2 = lib2::get_system_code(); |
| 31 | |
| 32 | BOOST_TEST_EQ( e1, e2 ); |
| 33 | |
| 34 | BOOST_TEST_EQ( hash_value( e1 ), hash_value( e2 ) ); |
| 35 | } |
| 36 | |
| 37 | { |
| 38 | error_code e1 = lib1::get_generic_code(); |
| 39 | error_code e2 = lib2::get_generic_code(); |
| 40 | |
| 41 | BOOST_TEST_EQ( e1, e2 ); |
| 42 | |
| 43 | BOOST_TEST_EQ( hash_value( e1 ), hash_value( e2 ) ); |
| 44 | } |
| 45 | |
| 46 | return boost::report_errors(); |
| 47 | } |
| 48 |
