Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / test / test / execution_monitor-ts / boost_exception-test.cpp
index fb6ffa4..5a8ec58 100644 (file)
@@ -25,12 +25,13 @@ using boost::test_tools::output_test_stream;
 using namespace boost::unit_test;
 
 typedef boost::error_info<struct tag_error_code, boost::uint32_t> error_code;
+typedef boost::error_info<struct tag_error_string, std::string> error_string;
 struct myexception : std::exception, virtual boost::exception
 {};
 
 // this one should generate a message as it does not execute any assertion
 void exception_raised() {
-    BOOST_THROW_EXCEPTION( myexception() << error_code(123) );
+    BOOST_THROW_EXCEPTION( myexception() << error_code(123) << error_string("error%%string") );
 }
 
 struct output_test_stream2 : public output_test_stream {
@@ -60,8 +61,11 @@ BOOST_AUTO_TEST_CASE( test_logs )
     // the message is "Dynamic exception type: boost::exception_detail::clone_impl<myexception>" on Unix
     // and "Dynamic exception type: boost::exception_detail::clone_impl<struct myexception>" on Windows.
     // Also contains "[tag_error_code*] = 123" on Unix and "[struct tag_error_code * __ptr64] = 123" On Windows
+    // Also contains "[tag_error_string*] = error%%string" on Unix and "[struct tag_error_string * __ptr64] = error%%string" On Windows
     BOOST_TEST(error_string.find("tag_error_code") != std::string::npos);
     BOOST_TEST(error_string.find("= 123") != std::string::npos);
+    BOOST_TEST(error_string.find("tag_error_string") != std::string::npos);
+    BOOST_TEST(error_string.find("= error%%string") != std::string::npos);
     BOOST_TEST(error_string.find("Dynamic exception type") != std::string::npos);
     BOOST_TEST(error_string.find("boost::wrapexcept<") != std::string::npos);
     BOOST_TEST(error_string.find("myexception>") != std::string::npos);