MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / TEST

Function TEST

dependencies/hueplusplus-1.0.0/test/test_TimePattern.cpp:31–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29using namespace std::chrono_literals;
30
31TEST(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
47TEST(Time, timepointToTimestamp)
48{

Callers

nothing calls this directly

Calls 15

parseTimestampFunction · 0.85
timepointToTimestampFunction · 0.85
parseDurationFunction · 0.85
durationTo_hh_mm_ssFunction · 0.85
AbsoluteVariedTimeClass · 0.85
WeekdaysClass · 0.85
getBaseTimeMethod · 0.80
getRandomVariationMethod · 0.80
toStringMethod · 0.80
isNoneMethod · 0.80
isMondayMethod · 0.80
isSundayMethod · 0.80

Tested by

no test coverage detected