mirror of
https://github.com/boostorg/exception.git
synced 2025-07-13 04:26:44 +02:00
improved memory leak test.
[SVN r59372]
This commit is contained in:
@ -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();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user