Merging from trunk: new function diagnostic_information_what, and mutable error info access.

[SVN r56477]
This commit is contained in:
Emil Dotchevski
2009-09-29 20:38:11 +00:00
parent d32fff4fb2
commit 6434a2031c
32 changed files with 9991 additions and 9480 deletions

View File

@ -83,6 +83,23 @@ basic_test()
}
catch(
test_exception & x )
{
++*boost::get_error_info<test_1>(x);
++*boost::get_error_info<test_2>(x);
++*boost::get_error_info<test_3>(x);
BOOST_TEST(*boost::get_error_info<test_1>(x)==2);
BOOST_TEST(*boost::get_error_info<test_2>(x)==3u);
BOOST_TEST(*boost::get_error_info<test_3>(x)==4.14159f);
BOOST_TEST(!boost::get_error_info<test_4>(x));
}
try
{
test_exception x;
x << test_1(1) << test_2(2u) << test_3(3.14159f);
throw x;
}
catch(
test_exception const & x )
{
BOOST_TEST(*boost::get_error_info<test_1>(x)==1);
BOOST_TEST(*boost::get_error_info<test_2>(x)==2u);
@ -317,6 +334,28 @@ test_lifetime()
BOOST_TEST(!count);
}
bool
is_const( int const * )
{
return true;
}
bool
is_const( int * )
{
return false;
}
void
test_const()
{
test_exception e;
boost::exception const & c(e);
boost::exception & m(e);
BOOST_TEST(is_const(boost::get_error_info<test_1>(c)));
BOOST_TEST(!is_const(boost::get_error_info<test_1>(m)));
}
int
main()
{
@ -327,5 +366,6 @@ main()
test_catch_add_info();
test_add_tuple();
test_lifetime();
test_const();
return boost::report_errors();
}