From f1af13409d6cd08b24f8fb9a8f1b0f9dffba6a6d Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Thu, 6 Jun 2019 15:09:27 -0700 Subject: [PATCH] BOOST_NO_EXCEPTIONS tests updated for [noreturn] --- .gitignore | 1 + test/2-throw_exception_no_exceptions_test.cpp | 8 ++------ test/4-throw_exception_no_both_test.cpp | 8 ++------ 3 files changed, 5 insertions(+), 12 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..342f845 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.vscode/ipch/* diff --git a/test/2-throw_exception_no_exceptions_test.cpp b/test/2-throw_exception_no_exceptions_test.cpp index 91b84b7..02f0e96 100644 --- a/test/2-throw_exception_no_exceptions_test.cpp +++ b/test/2-throw_exception_no_exceptions_test.cpp @@ -5,19 +5,16 @@ #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; + exit(0); } } @@ -25,6 +22,5 @@ int main() { boost::throw_exception(my_exception()); - BOOST_TEST(called); - return boost::report_errors(); + return 1; } diff --git a/test/4-throw_exception_no_both_test.cpp b/test/4-throw_exception_no_both_test.cpp index 789bb74..421ad45 100644 --- a/test/4-throw_exception_no_both_test.cpp +++ b/test/4-throw_exception_no_both_test.cpp @@ -6,19 +6,16 @@ #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; + exit(0); } } @@ -26,6 +23,5 @@ int main() { boost::throw_exception(my_exception()); - BOOST_TEST(called); - return boost::report_errors(); + return 1; }