diff options
Diffstat (limited to 'test/std/thread/thread.mutex/thread.lock/thread.lock.unique')
7 files changed, 34 insertions, 5 deletions
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp index 33e400b0da80..0939a5792644 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_duration.pass.cpp @@ -9,6 +9,8 @@ // // UNSUPPORTED: libcpp-has-no-threads +// FLAKY_TEST. + // <mutex> // class timed_mutex; diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp index 2ead67097730..ceb29370182d 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex_time_point.pass.cpp @@ -9,6 +9,8 @@ // // UNSUPPORTED: libcpp-has-no-threads +// FLAKY_TEST. + // <mutex> // class timed_mutex; diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp index 6ce33761068f..cb5c55925eef 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/lock.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // <mutex> @@ -21,6 +20,8 @@ #include <cstdlib> #include <cassert> +#include "test_macros.h" + std::mutex m; typedef std::chrono::system_clock Clock; @@ -38,6 +39,7 @@ void f() assert(lk.owns_lock() == true); ns d = t1 - t0 - ms(250); assert(d < ms(25)); // within 25ms +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.lock(); @@ -47,8 +49,10 @@ void f() { assert(e.code().value() == EDEADLK); } +#endif lk.unlock(); lk.release(); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.lock(); @@ -58,6 +62,7 @@ void f() { assert(e.code().value() == EPERM); } +#endif } int main() diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp index 27d0562de31f..709c56978af8 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // <mutex> @@ -19,6 +18,8 @@ #include <mutex> #include <cassert> +#include "test_macros.h" + bool try_lock_called = false; struct mutex @@ -39,6 +40,7 @@ int main() assert(lk.try_lock() == true); assert(try_lock_called == true); assert(lk.owns_lock() == true); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.try_lock(); @@ -48,11 +50,13 @@ int main() { assert(e.code().value() == EDEADLK); } +#endif lk.unlock(); assert(lk.try_lock() == false); assert(try_lock_called == false); assert(lk.owns_lock() == false); lk.release(); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.try_lock(); @@ -62,4 +66,5 @@ int main() { assert(e.code().value() == EPERM); } +#endif } diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp index 6f0a7219d2d8..6c981787d4b4 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_for.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // <mutex> @@ -20,6 +19,8 @@ #include <mutex> #include <cassert> +#include "test_macros.h" + bool try_lock_for_called = false; typedef std::chrono::milliseconds ms; @@ -44,6 +45,7 @@ int main() assert(lk.try_lock_for(ms(5)) == true); assert(try_lock_for_called == true); assert(lk.owns_lock() == true); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.try_lock_for(ms(5)); @@ -53,11 +55,13 @@ int main() { assert(e.code().value() == EDEADLK); } +#endif lk.unlock(); assert(lk.try_lock_for(ms(5)) == false); assert(try_lock_for_called == false); assert(lk.owns_lock() == false); lk.release(); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.try_lock_for(ms(5)); @@ -67,4 +71,5 @@ int main() { assert(e.code().value() == EPERM); } +#endif } diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp index b7e87249b596..57231b207a72 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/try_lock_until.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // <mutex> @@ -20,6 +19,8 @@ #include <mutex> #include <cassert> +#include "test_macros.h" + bool try_lock_until_called = false; struct mutex @@ -44,6 +45,7 @@ int main() assert(lk.try_lock_until(Clock::now()) == true); assert(try_lock_until_called == true); assert(lk.owns_lock() == true); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.try_lock_until(Clock::now()); @@ -53,11 +55,13 @@ int main() { assert(e.code().value() == EDEADLK); } +#endif lk.unlock(); assert(lk.try_lock_until(Clock::now()) == false); assert(try_lock_until_called == false); assert(lk.owns_lock() == false); lk.release(); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.try_lock_until(Clock::now()); @@ -67,4 +71,5 @@ int main() { assert(e.code().value() == EPERM); } +#endif } diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp index 62497c9ec45a..124ff551f947 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.locking/unlock.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// // -// XFAIL: libcpp-no-exceptions // UNSUPPORTED: libcpp-has-no-threads // <mutex> @@ -19,6 +18,8 @@ #include <mutex> #include <cassert> +#include "test_macros.h" + bool unlock_called = false; struct mutex @@ -35,6 +36,7 @@ int main() lk.unlock(); assert(unlock_called == true); assert(lk.owns_lock() == false); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.unlock(); @@ -44,7 +46,9 @@ int main() { assert(e.code().value() == EPERM); } +#endif lk.release(); +#ifndef TEST_HAS_NO_EXCEPTIONS try { lk.unlock(); @@ -54,4 +58,5 @@ int main() { assert(e.code().value() == EPERM); } +#endif } |
