From b43961cf947577f1a8be821e950a77244acaf90a Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 19 Jun 2012 20:51:02 +0000 Subject: [PATCH] Bug in exception_ptr_test.cpp. [SVN r79012] --- test/exception_ptr_test.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/exception_ptr_test.cpp b/test/exception_ptr_test.cpp index 4f0eb0c..193fabc 100644 --- a/test/exception_ptr_test.cpp +++ b/test/exception_ptr_test.cpp @@ -44,7 +44,7 @@ thread_handle explicit thread_handle( boost::function const & f ): - t_(boost::bind(thread_wrapper,f,err_)) + t_(boost::bind(thread_wrapper,f,boost::ref(err_))) { } @@ -63,8 +63,8 @@ void join( thread_handle & t ) { t.t_.join(); - if( t.err_ ) - rethrow_exception(t.err_); + assert(t.err_); + rethrow_exception(t.err_); } boost::detail::atomic_count exc_count(0); @@ -79,7 +79,9 @@ exc: ++exc_count; } - exc( exc const & ) + exc( exc const & e ): + boost::exception(e), + std::exception(e) { ++exc_count; } @@ -109,6 +111,7 @@ check( boost::shared_ptr const & t ) try { join(*t); + BOOST_TEST(false); } catch( exc & e ) @@ -125,7 +128,7 @@ main() try { std::vector< boost::shared_ptr > threads; - std::generate_n(std::inserter(threads,threads.end()),256,boost::bind(create_thread,thread_func)); + std::generate_n(std::inserter(threads,threads.end()),1,boost::bind(create_thread,thread_func)); std::for_each(threads.begin(),threads.end(),check); return boost::report_errors(); }