// Copyright Catch2 Authors // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 #include #include #include #include #include TEST_CASE( "ThreadAssertionTest", "[Multithreading]" ) { std::atomic_bool should_stop = false; SECTION( "Basic" ) { std::thread a([&should_stop] () { while (!should_stop) { FAIL_CHECK(false); CHECK(true); } }); std::thread b([&should_stop] () { while (!should_stop) { FAIL_CHECK(false); CHECK(true); } }); std::this_thread::sleep_for( std::chrono::milliseconds( 1'000 ) ); should_stop = true; a.join(); b.join(); } }