diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-06 18:06:50 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-10 09:47:32 -0400 |
commit | fadafb83cff9a9a340eac1b5a853e2467d5e0ef7 (patch) | |
tree | 62583dfe70fc70cfde198ca12c1872ef79adc5a6 /src/test/scheduler_tests.cpp | |
parent | fa70ccc6c4e304646b4610228f3975b3a9762643 (diff) | |
download | bitcoin-fadafb83cff9a9a340eac1b5a853e2467d5e0ef7.tar.xz |
scheduler: Make schedule* methods type safe
Diffstat (limited to 'src/test/scheduler_tests.cpp')
-rw-r--r-- | src/test/scheduler_tests.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp index 7d26840b73..fb95802b67 100644 --- a/src/test/scheduler_tests.cpp +++ b/src/test/scheduler_tests.cpp @@ -150,10 +150,10 @@ BOOST_AUTO_TEST_CASE(mockforward) CScheduler::Function dummy = [&counter]{counter++;}; // schedule jobs for 2, 5 & 8 minutes into the future - int64_t min_in_milli = 60*1000; - scheduler.scheduleFromNow(dummy, 2*min_in_milli); - scheduler.scheduleFromNow(dummy, 5*min_in_milli); - scheduler.scheduleFromNow(dummy, 8*min_in_milli); + + scheduler.scheduleFromNow(dummy, std::chrono::minutes{2}); + scheduler.scheduleFromNow(dummy, std::chrono::minutes{5}); + scheduler.scheduleFromNow(dummy, std::chrono::minutes{8}); // check taskQueue std::chrono::system_clock::time_point first, last; @@ -163,10 +163,10 @@ BOOST_AUTO_TEST_CASE(mockforward) std::thread scheduler_thread([&]() { scheduler.serviceQueue(); }); // bump the scheduler forward 5 minutes - scheduler.MockForward(std::chrono::seconds(5*60)); + scheduler.MockForward(std::chrono::minutes{5}); // ensure scheduler has chance to process all tasks queued for before 1 ms from now. - scheduler.scheduleFromNow([&scheduler]{ scheduler.stop(false); }, 1); + scheduler.scheduleFromNow([&scheduler] { scheduler.stop(false); }, std::chrono::milliseconds{1}); scheduler_thread.join(); // check that the queue only has one job remaining |