mirror of
https://github.com/boostorg/system.git
synced 2025-07-29 20:17:13 +02:00
Add after_main_test
This commit is contained in:
@ -126,6 +126,7 @@ system-run win32_hresult_test.cpp ;
|
||||
system-run error_category_test.cpp ;
|
||||
system-run generic_category_test.cpp ;
|
||||
system-run system_category_test.cpp ;
|
||||
system-run after_main_test.cpp after_main_test_1.cpp after_main_test_2.cpp ;
|
||||
|
||||
# Quick (CI) test
|
||||
run quick.cpp ;
|
||||
|
26
test/after_main_test.cpp
Normal file
26
test/after_main_test.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
// Copyright 2018 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
#include <boost/core/quick_exit.hpp>
|
||||
|
||||
using namespace boost::system;
|
||||
|
||||
struct Z
|
||||
{
|
||||
~Z()
|
||||
{
|
||||
BOOST_TEST_CSTR_EQ( generic_category().name(), "generic" );
|
||||
BOOST_TEST_CSTR_EQ( system_category().name(), "system" );
|
||||
|
||||
boost::quick_exit( boost::report_errors() );
|
||||
}
|
||||
};
|
||||
|
||||
static Z z;
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
9
test/after_main_test_1.cpp
Normal file
9
test/after_main_test_1.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
// Copyright 2018 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
|
||||
using namespace boost::system;
|
||||
|
||||
static error_code e1( 1, system_category() );
|
10
test/after_main_test_2.cpp
Normal file
10
test/after_main_test_2.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
// Copyright 2018 Peter Dimov.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <cerrno>
|
||||
|
||||
using namespace boost::system;
|
||||
|
||||
static error_code e2( ENOENT, generic_category() );
|
Reference in New Issue
Block a user