From 5e0db220753dceca31df3155519d412fb4aff875 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 20 Sep 2021 17:41:34 +0300 Subject: [PATCH] Include errc.hpp in system_error.hpp --- include/boost/system/system_error.hpp | 2 +- test/CMakeLists.txt | 1 + test/Jamfile.v2 | 1 + test/system_error_test2.cpp | 41 +++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 test/system_error_test2.cpp diff --git a/include/boost/system/system_error.hpp b/include/boost/system/system_error.hpp index 1d97b07..52008f5 100644 --- a/include/boost/system/system_error.hpp +++ b/include/boost/system/system_error.hpp @@ -6,8 +6,8 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include #include -#include #include #include #include diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 13ebfd1..6a94bb1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -103,6 +103,7 @@ boost_test(TYPE run SOURCES ec_location_test.cpp) boost_test(TYPE run SOURCES error_condition_test3.cpp) boost_test(TYPE run SOURCES error_code_test2.cpp) +boost_test(TYPE run SOURCES system_error_test2.cpp) # result diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 0c3cd6c..e9ae669 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -125,6 +125,7 @@ run ec_location_test.cpp ; run error_condition_test3.cpp ; run error_code_test2.cpp ; +run system_error_test2.cpp ; # result diff --git a/test/system_error_test2.cpp b/test/system_error_test2.cpp new file mode 100644 index 0000000..206983a --- /dev/null +++ b/test/system_error_test2.cpp @@ -0,0 +1,41 @@ +// Copyright 2021 Peter Dimov +// Distributed under the Boost Software License, Version 1.0 +// https://www.boost.org/LICENSE_1_0.txt + +#include +#include +#include + +namespace sys = boost::system; + +int main() +{ + { + sys::error_code ec( 5, sys::generic_category() ); + sys::system_error x1( ec ); + (void)x1; + } + + { + sys::error_code ec( 5, sys::system_category() ); + sys::system_error x1( ec ); + (void)x1; + } + + { + sys::system_error x1( make_error_code( sys::errc::invalid_argument ) ); + (void)x1; + } + + { + sys::system_error x1( 5, sys::generic_category() ); + (void)x1; + } + + { + sys::system_error x1( 5, sys::system_category() ); + (void)x1; + } + + return boost::report_errors(); +}