diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:47:26 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:47:26 +0000 |
| commit | 51072bd6bf79ef2bc6a922079bff57c31c1effbc (patch) | |
| tree | 91a2effbc9e6f80bdbbf9eb70e06c51ad0867ea0 /test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp | |
| parent | bb5e33f003797b67974a8893f7f2930fc51b8210 (diff) | |
Notes
Diffstat (limited to 'test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp')
| -rw-r--r-- | test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp index 0512e49dcb33..f0c3ef74c9ab 100644 --- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp +++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/join.pass.cpp @@ -19,6 +19,9 @@ #include <new> #include <cstdlib> #include <cassert> +#include <system_error> + +#include "test_macros.h" class G { @@ -42,6 +45,8 @@ public: int G::n_alive = 0; bool G::op_run = false; +void foo() {} + int main() { { @@ -50,5 +55,23 @@ int main() assert(t0.joinable()); t0.join(); assert(!t0.joinable()); +#ifndef TEST_HAS_NO_EXCEPTIONS + try { + t0.join(); + assert(false); + } catch (std::system_error const&) { + } +#endif + } +#ifndef TEST_HAS_NO_EXCEPTIONS + { + std::thread t0(foo); + t0.detach(); + try { + t0.join(); + assert(false); + } catch (std::system_error const&) { + } } +#endif } |
