|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85708 - trunk/libs/thread/test/sync/futures/future
From: vicente.botet_at_[hidden]
Date: 2013-09-16 13:15:06
Author: viboes
Date: 2013-09-16 13:15:05 EDT (Mon, 16 Sep 2013)
New Revision: 85708
URL: http://svn.boost.org/trac/boost/changeset/85708
Log:
Thread: add test for get_exception_ptr.
Text files modified:
trunk/libs/thread/test/sync/futures/future/get_pass.cpp | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
Modified: trunk/libs/thread/test/sync/futures/future/get_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/future/get_pass.cpp Mon Sep 16 13:13:20 2013 (r85707)
+++ trunk/libs/thread/test/sync/futures/future/get_pass.cpp 2013-09-16 13:15:05 EDT (Mon, 16 Sep 2013) (r85708)
@@ -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