diff --git a/tests/task_cancel.cpp b/tests/task_cancel.cpp index 07c107e..32f9fec 100644 --- a/tests/task_cancel.cpp +++ b/tests/task_cancel.cpp @@ -2,10 +2,23 @@ #include #include +#include #include +#include #include #include +BOOST_AUTO_TEST_CASE( leave_mutex_locked ) +{ + { + fc::mutex test_mutex; + fc::future test_task = fc::async([&](){ fc::scoped_lock test_lock(test_mutex); for (int i = 0; i < 10; ++i) fc::usleep(fc::seconds(1));}); + fc::usleep(fc::seconds(3)); + test_task.cancel_and_wait(); + } + BOOST_TEST_PASSPOINT(); +} + BOOST_AUTO_TEST_CASE( test_non_preemptable_assertion ) { return; // this isn't a real test, because the thing it tries to test works by asserting, not by throwing