This unit test checks whether the actual output of MockTimer::Report() is the same as fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of page faults that are returned by MockTimer.
| 40 | // same as fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number |
| 41 | // of page faults that are returned by MockTimer. |
| 42 | TEST(MockTimer, DoNothing) { |
| 43 | std::ostringstream buf; |
| 44 | |
| 45 | PrintTimerDescription(&buf); |
| 46 | MockTimer timer(&buf); |
| 47 | timer.Start(); |
| 48 | |
| 49 | // Do nothing. |
| 50 | |
| 51 | timer.Stop(); |
| 52 | timer.Report("TimerTest"); |
| 53 | |
| 54 | EXPECT_EQ(0.019123, timer.CPUTime()); |
| 55 | EXPECT_EQ(0.019723, timer.WallTime()); |
| 56 | EXPECT_EQ(0.012723, timer.UserTime()); |
| 57 | EXPECT_EQ(0.002723, timer.SystemTime()); |
| 58 | EXPECT_EQ( |
| 59 | " PASS name CPU time WALL time USR time" |
| 60 | " SYS time\n TimerTest 0.02 0.02" |
| 61 | " 0.01 0.00\n", |
| 62 | buf.str()); |
| 63 | } |
| 64 | |
| 65 | // This unit test checks whether the ScopedTimer<MockTimer> correctly reports |
| 66 | // the fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of |
nothing calls this directly
no test coverage detected