|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59372 - trunk/libs/exception/test
From: emil_at_[hidden]
Date: 2010-01-30 15:05:32
Author: emildotchevski
Date: 2010-01-30 15:05:31 EST (Sat, 30 Jan 2010)
New Revision: 59372
URL: http://svn.boost.org/trac/boost/changeset/59372
Log:
improved memory leak test.
Text files modified:
trunk/libs/exception/test/error_info_test.cpp | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
Modified: trunk/libs/exception/test/error_info_test.cpp
==============================================================================
--- trunk/libs/exception/test/error_info_test.cpp (original)
+++ trunk/libs/exception/test/error_info_test.cpp 2010-01-30 15:05:31 EST (Sat, 30 Jan 2010)
@@ -5,6 +5,7 @@
#include <boost/exception/get_error_info.hpp>
#include <boost/exception/info_tuple.hpp>
+#include <boost/exception_ptr.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/detail/workaround.hpp>
@@ -302,7 +303,7 @@
}
void
-test_lifetime()
+test_lifetime1()
{
int count=0;
try
@@ -323,6 +324,19 @@
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
is_const( int const * )
{
@@ -354,7 +368,8 @@
test_basic_throw_catch();
test_catch_add_info();
test_add_tuple();
- test_lifetime();
+ test_lifetime1();
+ test_lifetime2();
test_const();
return boost::report_errors();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk