|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85843 - branches/release/libs/thread/test/sync/futures/future
From: vicente.botet_at_[hidden]
Date: 2013-09-22 19:35:04
Author: viboes
Date: 2013-09-22 19:35:04 EDT (Sun, 22 Sep 2013)
New Revision: 85843
URL: http://svn.boost.org/trac/boost/changeset/85843
Log:
Thread: add a test on get_exception_ptr.
Text files modified:
branches/release/libs/thread/test/sync/futures/future/get_pass.cpp | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
Modified: branches/release/libs/thread/test/sync/futures/future/get_pass.cpp
==============================================================================
--- branches/release/libs/thread/test/sync/futures/future/get_pass.cpp Sun Sep 22 19:33:52 2013 (r85842)
+++ branches/release/libs/thread/test/sync/futures/future/get_pass.cpp 2013-09-22 19:35:04 EDT (Sun, 22 Sep 2013) (r85843)
@@ -189,6 +189,26 @@
BOOST_TEST(!f.valid());
#endif
}
+ BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
+ {
+ boost::promise<T> p;
+ boost::future<T> f = p.get_future();
+#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ boost::thread(func4, boost::move(p)).detach();
+#else
+ p.set_exception(boost::make_exception_ptr(3.5));
+#endif
+ try
+ {
+ BOOST_TEST(f.valid());
+ boost::exception_ptr ptr = f.get_exception_ptr();
+ }
+ catch (...)
+ {
+ BOOST_TEST(false);
+ }
+ BOOST_TEST(f.valid());
+ }
}
BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;
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