]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/system/test/generic_category_test3.cpp
1 // Copyright 2020 Peter Dimov
2 // Distributed under the Boost Software License, Version 1.0
3 // http://www.boost.org/LICENSE_1_0.txt
5 #include <boost/system/generic_category.hpp>
6 #include <boost/system/error_condition.hpp>
7 #include <boost/core/lightweight_test.hpp>
10 namespace sys
= boost::system
;
14 sys::error_category
const & cat
= sys::generic_category();
17 BOOST_TEST_CSTR_EQ( cat
.name(), "generic" );
19 // default_error_condition
20 BOOST_TEST( cat
.default_error_condition( 0 ) == sys::error_condition( 0, cat
) );
21 BOOST_TEST( cat
.default_error_condition( ENOENT
) == sys::error_condition( ENOENT
, cat
) );
22 BOOST_TEST( cat
.default_error_condition( -1 ) == sys::error_condition( -1, cat
) );
25 BOOST_TEST( !cat
.failed( 0 ) );
26 BOOST_TEST( cat
.failed( ENOENT
) );
27 BOOST_TEST( cat
.failed( -1 ) );
29 return boost::report_errors();