MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/base/base_tests/timer_test.cpp:6–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "base/timer.hpp"
5
6UNIT_TEST(Timer_Seconds)
7{
8 base::Timer timer;
9
10 double t1 = timer.ElapsedSeconds();
11 double s = 0.0;
12 for (int i = 0; i < 10000000; ++i)
13 s += i * 0.01;
14 double t2 = timer.ElapsedSeconds();
15
16 TEST_NOT_EQUAL(s, 0.0, ("Fictive, to prevent loop optimization"));
17 TEST_NOT_EQUAL(t1, t2, ("Timer values should not be equal"));
18}
19
20UNIT_TEST(Timer_CurrentStringTime)
21{

Callers

nothing calls this directly

Calls 7

FormatCurrentTimeFunction · 0.85
StringToTimestampFunction · 0.85
GenerateYYMMDDFunction · 0.85
SecondsSinceEpochToTimeTFunction · 0.85
TimeTToSecondsSinceEpochFunction · 0.85
ElapsedSecondsMethod · 0.80
TimestampToStringFunction · 0.50

Tested by

no test coverage detected