11#include < pybind11/critical_section.h>
22
3- #include " catch.hpp"
43#include " pybind11_tests.h"
54
65#include < atomic>
6+ #include < cassert>
77#include < thread>
88
99#ifdef PYBIND11_CPP20
@@ -36,7 +36,7 @@ void test_scoped_critical_section(py::class_<BoolWrapper> &cls) {
3636 barrier.arrive_and_wait ();
3737 py::scoped_critical_section lock{bool_wrapper};
3838 auto bw = bool_wrapper.cast <std::shared_ptr<BoolWrapper>>();
39- REQUIRE (bw->get () == true );
39+ assert (bw->get () == true );
4040 });
4141
4242 t1.join ();
@@ -62,14 +62,14 @@ void test_scoped_critical_section2(py::class_<BoolWrapper> &cls) {
6262 barrier.arrive_and_wait ();
6363 py::scoped_critical_section lock{bool_wrapper1};
6464 auto bw1 = bool_wrapper1.cast <std::shared_ptr<BoolWrapper>>();
65- REQUIRE (bw1->get () == true );
65+ assert (bw1->get () == true );
6666 });
6767
6868 std::thread t3 ([&]() {
6969 barrier.arrive_and_wait ();
7070 py::scoped_critical_section lock{bool_wrapper2};
7171 auto bw2 = bool_wrapper2.cast <std::shared_ptr<BoolWrapper>>();
72- REQUIRE (bw2->get () == true );
72+ assert (bw2->get () == true );
7373 });
7474
7575 t1.join ();
@@ -93,7 +93,7 @@ void test_scoped_critical_section2_same_object_no_deadlock(py::class_<BoolWrappe
9393 barrier.arrive_and_wait ();
9494 py::scoped_critical_section lock{bool_wrapper};
9595 auto bw = bool_wrapper.cast <std::shared_ptr<BoolWrapper>>();
96- REQUIRE (bw->get () == true );
96+ assert (bw->get () == true );
9797 });
9898
9999 t1.join ();
0 commit comments