forked from boostorg/throw_exception
Add make_exception_ptr_test
This commit is contained in:
@ -37,3 +37,5 @@ run throw_from_library_test.cpp lib1_throw lib2_throw lib3_throw : : : <link>sha
|
|||||||
|
|
||||||
run throw_exception_nx_test.cpp : : : <exception-handling>off ;
|
run throw_exception_nx_test.cpp : : : <exception-handling>off ;
|
||||||
run throw_exception_nx_test2.cpp : : : <exception-handling>off ;
|
run throw_exception_nx_test2.cpp : : : <exception-handling>off ;
|
||||||
|
|
||||||
|
run make_exception_ptr_test.cpp ;
|
||||||
|
18
test/make_exception_ptr_test.cpp
Normal file
18
test/make_exception_ptr_test.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// Copyright 2020 Peter Dimov
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
# pragma warning(disable: 4702) // unreachable code
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <boost/exception_ptr.hpp>
|
||||||
|
#include <boost/core/lightweight_test.hpp>
|
||||||
|
|
||||||
|
class my_exception: public std::exception {};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
BOOST_TEST_THROWS( boost::rethrow_exception( boost::make_exception_ptr( my_exception() ) ), my_exception );
|
||||||
|
return boost::report_errors();
|
||||||
|
}
|
Reference in New Issue
Block a user