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 {
// 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);