Commit 51f0e4d2 authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

fix test so it is timezone agnostic

parent 55867bb7
......@@ -212,15 +212,13 @@ TEST_CASE("door controller parses status json")
door_status_sync_status_task(nullptr);
schedule_data_p first = static_cast<schedule_data_p>(schedule_list->data);
struct tm start;
localtime_r(&first->start, &start);
gmtime_r(&first->start, &start);
struct tm end;
localtime_r(&first->end, &end);
gmtime_r(&first->end, &end);
// 10 o'clock in our current tie zone is going to come 3 hours early in a place behind us
// But since we are close to the end of the day roll over at midnight we roll over
// So 1 AM - 10 PM = 01 - 22 = -21
// I HATE TIMEZONES
// Also, west coast best coast
REQUIRE(end.tm_hour - start.tm_hour == -21);
REQUIRE(end.tm_hour - start.tm_hour == 3);
}
SECTION("parser wont parse invalid json")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment