MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/logging_tests.cpp:60–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58};
59
60BOOST_AUTO_TEST_CASE(logging_timer)
61{
62 SetMockTime(1);
63 auto micro_timer = BCLog::Timer<std::chrono::microseconds>("tests", "end_msg");
64 SetMockTime(2);
65 BOOST_CHECK_EQUAL(micro_timer.LogMsg("test micros"), "tests: test micros (1000000μs)");
66
67 SetMockTime(1);
68 auto ms_timer = BCLog::Timer<std::chrono::milliseconds>("tests", "end_msg");
69 SetMockTime(2);
70 BOOST_CHECK_EQUAL(ms_timer.LogMsg("test ms"), "tests: test ms (1000.00ms)");
71
72 SetMockTime(1);
73 auto sec_timer = BCLog::Timer<std::chrono::seconds>("tests", "end_msg");
74 SetMockTime(2);
75 BOOST_CHECK_EQUAL(sec_timer.LogMsg("test secs"), "tests: test secs (1.00s)");
76}
77
78BOOST_FIXTURE_TEST_CASE(logging_LogPrintf_, LogSetup)
79{

Callers

nothing calls this directly

Calls 7

SetMockTimeFunction · 0.85
LogFromLocationFunction · 0.85
LogFromLocationAndExpectFunction · 0.85
LogMsgMethod · 0.80
GetAvailableBytesMethod · 0.80
GetDroppedBytesMethod · 0.80
ConsumeMethod · 0.80

Tested by

no test coverage detected