diff --git a/test/1-throw_exception_test.cpp b/test/1-throw_exception_test.cpp new file mode 100644 index 0000000..5719e80 --- /dev/null +++ b/test/1-throw_exception_test.cpp @@ -0,0 +1,29 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//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 +#include + +class my_exception: public std::exception { }; + +int +main() + { + try + { + boost::throw_exception(my_exception()); + BOOST_ERROR("boost::throw_exception failed to throw."); + } + catch( + my_exception & ) + { + } + catch( + ... ) + { + BOOST_ERROR("boost::throw_exception malfunction."); + } + return boost::report_errors(); + } diff --git a/test/2-throw_exception_no_exceptions_test.cpp b/test/2-throw_exception_no_exceptions_test.cpp new file mode 100644 index 0000000..aca309d --- /dev/null +++ b/test/2-throw_exception_no_exceptions_test.cpp @@ -0,0 +1,30 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#define BOOST_NO_EXCEPTIONS +#include +#include + +class my_exception: public std::exception { }; + +bool called=false; + +namespace +boost + { + void + throw_exception( std::exception const & ) + { + called=true; + } + } + +int +main() + { + boost::throw_exception(my_exception()); + BOOST_TEST(called); + return boost::report_errors(); + } diff --git a/test/3-throw_exception_no_integration_test.cpp b/test/3-throw_exception_no_integration_test.cpp new file mode 100644 index 0000000..16b3d8c --- /dev/null +++ b/test/3-throw_exception_no_integration_test.cpp @@ -0,0 +1,30 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#define BOOST_EXCEPTION_DISABLE +#include +#include + +class my_exception: public std::exception { }; + +int +main() + { + try + { + boost::throw_exception(my_exception()); + BOOST_ERROR("boost::throw_exception failed to throw."); + } + catch( + my_exception & ) + { + } + catch( + ... ) + { + BOOST_ERROR("boost::throw_exception malfunction."); + } + return boost::report_errors(); + } diff --git a/test/4-throw_exception_no_both_test.cpp b/test/4-throw_exception_no_both_test.cpp new file mode 100644 index 0000000..4c58605 --- /dev/null +++ b/test/4-throw_exception_no_both_test.cpp @@ -0,0 +1,31 @@ +//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. + +//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) + +#define BOOST_NO_EXCEPTIONS +#define BOOST_EXCEPTION_DISABLE +#include +#include + +class my_exception: public std::exception { }; + +bool called=false; + +namespace +boost + { + void + throw_exception( std::exception const & ) + { + called=true; + } + } + +int +main() + { + boost::throw_exception(my_exception()); + BOOST_TEST(called); + return boost::report_errors(); + }