From f60eeaf08c598fb7122b12865eef5c5bd1b7cb31 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() --- beast/unit_test/thread.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/beast/unit_test/thread.h b/beast/unit_test/thread.h index fb1fc50cc..90e6fb3d2 100644 --- a/beast/unit_test/thread.h +++ b/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"); + } } };