1// Copyright 2021 Peter Dimov
2// Distributed under the Boost Software License, Version 1.0
3// https://www.boost.org/LICENSE_1_0.txt
4
5#include <boost/system/system_error.hpp>
6#include <boost/core/lightweight_test.hpp>
7#include <cerrno>
8
9namespace sys = boost::system;
10
11int main()
12{
13 {
14 sys::error_code ec( 5, sys::generic_category() );
15 sys::system_error x1( ec );
16 (void)x1;
17 }
18
19 {
20 sys::error_code ec( 5, sys::system_category() );
21 sys::system_error x1( ec );
22 (void)x1;
23 }
24
25 {
26 sys::system_error x1( make_error_code( e: sys::errc::invalid_argument ) );
27 (void)x1;
28 }
29
30 {
31 sys::system_error x1( 5, sys::generic_category() );
32 (void)x1;
33 }
34
35 {
36 sys::system_error x1( 5, sys::system_category() );
37 (void)x1;
38 }
39
40 return boost::report_errors();
41}
42

source code of boost/libs/system/test/system_error_test2.cpp