Test case added.

This commit is contained in:
Per Malmberg
2018-03-09 08:26:57 -08:00
parent 22da55666a
commit 74800b0d5e
2 changed files with 79 additions and 41 deletions

View File

@@ -249,16 +249,31 @@ SCENARIO("Calculating next runtime")
REQUIRE(t.hour == 1);
REQUIRE(t.min == 0);
REQUIRE(t.sec == 0);
}
}
AND_WHEN("Start time 05:00:00")
{
sys_days midnight = 2010_y/1/1;
system_clock::time_point five = midnight;
five += hours{5};
auto t2 = CronSchedule::to_calendar_time(five);
// auto t = std::chrono::system_clock::to_time_t(run_time);
// REQUIRE(t.get_seconds() == 0);
// REQUIRE(t.minute == 0);
// REQUIRE(t.hour == 1);
// REQUIRE(t.)
std::chrono::system_clock::time_point run_time = sched.calculate_from(five);
THEN("Next runtime is 06:00 of the same date")
{
auto t = CronSchedule::to_calendar_time(run_time);
REQUIRE(t.year == 2010);
REQUIRE(t.month == 1);
REQUIRE(t.day == 1);
REQUIRE(t.hour == 6);
REQUIRE(t.min == 0);
REQUIRE(t.sec == 0);
}
}
}
}