mirror of
https://github.com/boostorg/system.git
synced 2025-07-29 20:17:13 +02:00
Merge branch 'develop' into feature/std-category
This commit is contained in:
@ -6,8 +6,8 @@
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/system/errc.hpp>
|
||||
#include <boost/system/detail/error_code.hpp>
|
||||
#include <boost/system/detail/error_category_impl.hpp>
|
||||
#include <boost/system/detail/snprintf.hpp>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
41
test/system_error_test2.cpp
Normal file
41
test/system_error_test2.cpp
Normal file
@ -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 <boost/system/system_error.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
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();
|
||||
}
|
Reference in New Issue
Block a user