MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / testAbsoluteParseLocal

Method testAbsoluteParseLocal

Tests/Libraries/Time/TimeTest.cpp:47–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45};
46
47void SC::TimeTest::testAbsoluteParseLocal()
48{
49 //! [absoluteParseLocalSnippet]
50 Time::Absolute::ParseResult local;
51 SC_TEST_EXPECT(Time::Realtime::now().parseLocal(local));
52 SC_TEST_EXPECT(local.year > 2022);
53 String result;
54 (void)StringBuilder::format(result, "{} {:02}/{:02}/{} {:02}:{:02}:{:02} {}", local.getDay(), local.dayOfMonth,
55 local.getMonth(), local.year, local.hour, local.minutes, local.seconds,
56 local.isDaylightSaving ? "DAYLIGHT SAVING" : "NO DAYLIGHT SAVING");
57
58 report.console.printLine(result.view());
59 //! [absoluteParseLocalSnippet]
60}
61
62void SC::TimeTest::testHighResolutionCounterSnap()
63{

Callers

nothing calls this directly

Calls 6

parseLocalMethod · 0.80
getDayMethod · 0.80
getMonthMethod · 0.80
printLineMethod · 0.80
formatFunction · 0.50
viewMethod · 0.45

Tested by

no test coverage detected