From 7d6da0ad91e25d6994c370d941ac2c9a32296042 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 27 Aug 2020 17:49:20 +0300 Subject: [PATCH] Add tests for failed() --- test/generic_category_test3.cpp | 5 +++++ test/system_category_test3.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/test/generic_category_test3.cpp b/test/generic_category_test3.cpp index 5716059..5abc5f6 100644 --- a/test/generic_category_test3.cpp +++ b/test/generic_category_test3.cpp @@ -21,5 +21,10 @@ int main() BOOST_TEST( cat.default_error_condition( ENOENT ) == sys::error_condition( ENOENT, cat ) ); BOOST_TEST( cat.default_error_condition( -1 ) == sys::error_condition( -1, cat ) ); + // failed + BOOST_TEST( !cat.failed( 0 ) ); + BOOST_TEST( cat.failed( ENOENT ) ); + BOOST_TEST( cat.failed( -1 ) ); + return boost::report_errors(); } diff --git a/test/system_category_test3.cpp b/test/system_category_test3.cpp index d03a305..3005639 100644 --- a/test/system_category_test3.cpp +++ b/test/system_category_test3.cpp @@ -30,5 +30,10 @@ int main() #endif + // failed + BOOST_TEST( !cat.failed( 0 ) ); + BOOST_TEST( cat.failed( 5 ) ); + BOOST_TEST( cat.failed( -1 ) ); + return boost::report_errors(); }