improved memory leak test.

[SVN r59372]
This commit is contained in:
Emil Dotchevski
2010-01-30 20:05:31 +00:00
parent 2dc075e6e8
commit 6b30091ee3

View File

@ -5,6 +5,7 @@
#include <boost/exception/get_error_info.hpp> #include <boost/exception/get_error_info.hpp>
#include <boost/exception/info_tuple.hpp> #include <boost/exception/info_tuple.hpp>
#include <boost/exception_ptr.hpp>
#include <boost/detail/lightweight_test.hpp> #include <boost/detail/lightweight_test.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
@ -302,7 +303,7 @@ test_add_tuple()
} }
void void
test_lifetime() test_lifetime1()
{ {
int count=0; int count=0;
try try
@ -323,6 +324,19 @@ test_lifetime()
BOOST_TEST(!count); BOOST_TEST(!count);
} }
void
test_lifetime2()
{
int count=0;
{
boost::exception_ptr ep;
test_exception e; e<<test_7(user_data(count));
ep=boost::copy_exception(e);
BOOST_TEST(count>0);
}
BOOST_TEST(!count);
}
bool bool
is_const( int const * ) is_const( int const * )
{ {
@ -354,7 +368,8 @@ main()
test_basic_throw_catch(); test_basic_throw_catch();
test_catch_add_info(); test_catch_add_info();
test_add_tuple(); test_add_tuple();
test_lifetime(); test_lifetime1();
test_lifetime2();
test_const(); test_const();
return boost::report_errors(); return boost::report_errors();
} }