| 29 | using namespace std::chrono_literals; |
| 30 | |
| 31 | TEST(Time, parseTimestamp) |
| 32 | { |
| 33 | std::tm tm {}; |
| 34 | tm.tm_year = 2020 - 1900; |
| 35 | tm.tm_mon = 3 - 1; |
| 36 | tm.tm_mday = 24; |
| 37 | tm.tm_hour = 12; |
| 38 | tm.tm_min = 45; |
| 39 | tm.tm_sec = 0; |
| 40 | // Auto detect daylight savings time |
| 41 | tm.tm_isdst = -1; |
| 42 | const std::time_t ctime = std::mktime(&tm); |
| 43 | const auto timePoint = system_clock::from_time_t(ctime); |
| 44 | EXPECT_EQ(timePoint, parseTimestamp("2020-03-24T12:45:00")); |
| 45 | } |
| 46 | |
| 47 | TEST(Time, timepointToTimestamp) |
| 48 | { |
nothing calls this directly
no test coverage detected