forked from boostorg/system
Add generic_category_test3
This commit is contained in:
@@ -81,4 +81,5 @@ run error_category_test2.cpp ;
|
|||||||
run error_condition_test.cpp ;
|
run error_condition_test.cpp ;
|
||||||
run error_condition_test2.cpp ;
|
run error_condition_test2.cpp ;
|
||||||
run generic_category_test2.cpp ;
|
run generic_category_test2.cpp ;
|
||||||
|
run generic_category_test3.cpp ;
|
||||||
run system_category_test2.cpp ;
|
run system_category_test2.cpp ;
|
||||||
|
25
test/generic_category_test3.cpp
Normal file
25
test/generic_category_test3.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright 2020 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#include <boost/system/generic_category.hpp>
|
||||||
|
#include <boost/system/error_condition.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
#include <cerrno>
|
||||||
|
|
||||||
|
namespace sys = boost::system;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
sys::error_category const & cat = sys::generic_category();
|
||||||
|
|
||||||
|
// name
|
||||||
|
BOOST_TEST_CSTR_EQ( cat.name(), "generic" );
|
||||||
|
|
||||||
|
// default_error_condition
|
||||||
|
BOOST_TEST( cat.default_error_condition( 0 ) == sys::error_condition( 0, cat ) );
|
||||||
|
BOOST_TEST( cat.default_error_condition( ENOENT ) == sys::error_condition( ENOENT, cat ) );
|
||||||
|
BOOST_TEST( cat.default_error_condition( -1 ) == sys::error_condition( -1, cat ) );
|
||||||
|
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user