From 96418c15312646a8ad644aacdaa24b815ab5be32 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 27 Aug 2020 17:41:33 +0300 Subject: [PATCH] Add generic_category_test3 --- test/Jamfile.v2 | 1 + test/generic_category_test3.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/generic_category_test3.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 4ff3965..60150ea 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -81,4 +81,5 @@ run error_category_test2.cpp ; run error_condition_test.cpp ; run error_condition_test2.cpp ; run generic_category_test2.cpp ; +run generic_category_test3.cpp ; run system_category_test2.cpp ; diff --git a/test/generic_category_test3.cpp b/test/generic_category_test3.cpp new file mode 100644 index 0000000..5716059 --- /dev/null +++ b/test/generic_category_test3.cpp @@ -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 +#include +#include +#include + +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(); +}