1
0
forked from boostorg/core

Add no_exceptions_support_test

This commit is contained in:
Peter Dimov
2019-04-19 17:32:05 +03:00
parent d9b524d2e5
commit 0600b49827
2 changed files with 56 additions and 1 deletions

View File

@ -141,10 +141,13 @@ run test_lib_typeid.cpp lib_typeid : : : <link>shared : test_lib_typeid_shared ;
run test_lib_typeid.cpp lib_typeid : : : <link>static : test_lib_typeid_static ;
run test_lib_typeid.cpp lib_typeid : : : <link>shared <rtti>off : test_lib_typeid_shared_no_rtti ;
run test_lib_typeid.cpp lib_typeid : : : <link>static <rtti>off : test_lib_typeid_static_no_rtti ;
run test_lib_typeid.cpp lib_typeid : : : <link>static <rtti>off : test_lib_typeid_static_no_rtti ;
run uncaught_exceptions.cpp : : : <exception-handling>on ;
run uncaught_exceptions_np.cpp : : : <exception-handling>on ;
run no_exceptions_support_test.cpp ;
run no_exceptions_support_test.cpp : : : <exception-handling>off : no_exceptions_support_test_nx ;
use-project /boost/core/swap : ./swap ;
build-project ./swap ;

View File

@ -0,0 +1,52 @@
//
// Test for no_exceptions_support.hpp
//
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/quick_exit.hpp>
#include <boost/throw_exception.hpp>
#include <exception>
void f()
{
boost::throw_exception( std::exception() );
}
int main()
{
BOOST_TRY
{
f();
}
BOOST_CATCH( std::exception const& )
{
return 0;
}
BOOST_CATCH( ... )
{
return 1;
}
BOOST_CATCH_END
return 1;
}
#if defined(BOOST_NO_EXCEPTIONS)
namespace boost
{
void throw_exception( std::exception const& )
{
boost::quick_exit( 0 );
}
}
#endif