forked from boostorg/exception
decoupled boost/exception/exception.hpp from boost/exception/detail/type_info.hpp
diagnostic_information improvements documentation update [SVN r48469]
This commit is contained in:
@ -38,12 +38,6 @@ error3:
|
||||
{
|
||||
};
|
||||
|
||||
std::string
|
||||
get_diagnostic_information( std::exception const & x )
|
||||
{
|
||||
return boost::diagnostic_information(x);
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
@ -57,7 +51,7 @@ main()
|
||||
catch(
|
||||
std::exception & x )
|
||||
{
|
||||
std::string di=get_diagnostic_information(x);
|
||||
std::string di=boost::diagnostic_information(x);
|
||||
BOOST_TEST(di.find("type:")!=std::string::npos);
|
||||
BOOST_TEST(di.find("error1")!=std::string::npos);
|
||||
}
|
||||
@ -75,11 +69,26 @@ main()
|
||||
catch(
|
||||
std::exception & x )
|
||||
{
|
||||
std::string di=get_diagnostic_information(x);
|
||||
std::string di=boost::diagnostic_information(x);
|
||||
BOOST_TEST(di.find("type:")!=std::string::npos);
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_TEST(di.find("error2")!=std::string::npos);
|
||||
#endif
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
try
|
||||
{
|
||||
error2 x; x << tag_int(42);
|
||||
BOOST_TEST(x.what()==std::string("error2"));
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
boost::exception & x )
|
||||
{
|
||||
std::string di=boost::diagnostic_information(x);
|
||||
BOOST_TEST(di.find("type:")!=std::string::npos);
|
||||
BOOST_TEST(di.find("test_tag")!=std::string::npos);
|
||||
}
|
||||
catch(
|
||||
@ -96,9 +105,9 @@ main()
|
||||
catch(
|
||||
boost::exception & x )
|
||||
{
|
||||
std::string w1 = x.diagnostic_information();
|
||||
std::string w1 = diagnostic_information(x);
|
||||
x << tag_int(2);
|
||||
std::string w2 = x.diagnostic_information();
|
||||
std::string w2 = diagnostic_information(x);
|
||||
BOOST_TEST( w1!=w2 );
|
||||
BOOST_TEST(w1.find("test_tag")!=std::string::npos);
|
||||
BOOST_TEST(w2.find("test_tag")!=std::string::npos);
|
||||
|
Reference in New Issue
Block a user