summaryrefslogtreecommitdiff
path: root/libs/thread/test/sync/futures/async/async_pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/thread/test/sync/futures/async/async_pass.cpp')
-rw-r--r--libs/thread/test/sync/futures/async/async_pass.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/libs/thread/test/sync/futures/async/async_pass.cpp b/libs/thread/test/sync/futures/async/async_pass.cpp
index add6282cf..86fdfdbec 100644
--- a/libs/thread/test/sync/futures/async/async_pass.cpp
+++ b/libs/thread/test/sync/futures/async/async_pass.cpp
@@ -85,7 +85,7 @@ public:
return *this;
}
- int operator()()
+ int operator()() const
{
boost::this_thread::sleep_for(ms(200));
return 3;
@@ -167,6 +167,48 @@ struct check_timer {
int main()
{
+ {
+ try {
+ boost::async(f0);
+ } catch (std::exception& ex)
+ {
+ std::cout << __FILE__ << "[" << __LINE__ << "]" << ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ }
+ catch (...)
+ {
+ BOOST_TEST(false && "exception thrown");
+ }
+ }
+ {
+ try {
+ boost::async(boost::launch::async, f0);
+ } catch (std::exception& ex)
+ {
+ std::cout << __FILE__ << "[" << __LINE__ << "]" << ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ }
+ catch (...)
+ {
+ BOOST_TEST(false && "exception thrown");
+ }
+ }
+#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl;
+ {
+ try {
+ boost::async(boost::launch::deferred, f0);
+ } catch (std::exception& ex)
+ {
+ std::cout << __FILE__ << "[" << __LINE__ << "]" << ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ }
+ catch (...)
+ {
+ BOOST_TEST(false && "exception thrown");
+ }
+ }
+#endif
std::cout << __FILE__ << "[" << __LINE__ << "]" << std::endl;
{
try