From 7b3550c46e7373286edb994a0f98adc82bd8eb65 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 19 Mar 2016 08:57:01 -0400 Subject: [PATCH] unit_test::thread fixes: * Fail on exception in unit_test::thread * Add unit_test::thread::detach() --- src/beast/beast/unit_test/thread.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/beast/beast/unit_test/thread.h b/src/beast/beast/unit_test/thread.h index fb1fc50cc..90e6fb3d2 100644 --- a/src/beast/beast/unit_test/thread.h +++ b/src/beast/beast/unit_test/thread.h @@ -94,6 +94,12 @@ public: s_->propagate_abort(); } + void + detach() + { + t_.detach(); + } + void swap (thread& other) { @@ -112,6 +118,15 @@ private: catch (suite::abort_exception const&) { } + catch (std::exception const& e) + { + s_->fail ("unhandled exception: " + + std::string (e.what())); + } + catch (...) + { + s_->fail ("unhandled exception"); + } } };