Add after_main_test

This commit is contained in:
Peter Dimov
2018-09-22 15:17:47 +03:00
parent 1d4de72899
commit a627662e63
4 changed files with 46 additions and 0 deletions

View File

@ -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
View 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()
{
}

View 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() );

View 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() );