1
0
mirror of https://github.com/PerMalmberg/libcron.git synced 2025-12-20 02:59:09 -06:00

Added UTC handling for Windows

This commit is contained in:
Per Malmberg
2018-03-22 22:38:55 +01:00
parent 5395c75061
commit c441da4287
7 changed files with 80 additions and 27 deletions

View File

@@ -5,6 +5,7 @@
using namespace libcron;
using namespace std::chrono;
using namespace date;
std::string create_schedule_expiring_in(std::chrono::system_clock::time_point now, hours h, minutes m, seconds s)
{
@@ -221,7 +222,7 @@ class TestClock
SCENARIO("Clock changes")
{
GIVEN("A Cron instance with a single task expiring in 4h")
GIVEN("A Cron instance with a single task expiring every hour")
{
Cron<TestClock> c{};
auto& clock = c.get_clock();
@@ -239,11 +240,11 @@ SCENARIO("Clock changes")
WHEN("Clock changes <3h forward")
{
THEN("Task expires accordingly")
{
REQUIRE(c.tick() == 1);
clock.add(minutes{30}); // 00:30
REQUIRE(c.tick() == 0);
THEN("Task expires accordingly")
{
REQUIRE(c.tick() == 1);
clock.add(minutes{ 30 }); // 00:30
REQUIRE(c.tick() == 0);
clock.add(minutes{30}); // 01:00
REQUIRE(c.tick() == 1);
REQUIRE(c.tick() == 0);
@@ -294,6 +295,5 @@ SCENARIO("Clock changes")
REQUIRE(c.tick() == 1);
}
}
}
}