Skip to content

Commit

Permalink
Merge pull request #905 from CrowCpp/fix-task_timer_unit_test_timing
Browse files Browse the repository at this point in the history
changes sleep times and default timeout raised
  • Loading branch information
The-EDev authored Sep 29, 2024
2 parents 2583c27 + 638f981 commit 763933a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3922,8 +3922,8 @@ TEST_CASE("task_timer")

crow::detail::task_timer timer(io_service, std::chrono::milliseconds(100));
CHECK(timer.get_default_timeout() == 5);
timer.set_default_timeout(7);
CHECK(timer.get_default_timeout() == 7);
timer.set_default_timeout(9);
CHECK(timer.get_default_timeout() == 9);

timer.schedule([&a]() {
a = true;
Expand All @@ -3938,7 +3938,7 @@ TEST_CASE("task_timer")
this_thread::sleep_for(2 * timer.get_tick_length());
CHECK(a == true);
CHECK(b == false);
this_thread::sleep_for(2 * timer.get_tick_length());
this_thread::sleep_for(4 * timer.get_tick_length());
CHECK(a == true);
CHECK(b == true);

Expand Down

0 comments on commit 763933a

Please sign in to comment.