| 26 | namespace { |
| 27 | |
| 28 | TEST(BenchmarkHelpersTest, SleepForNegativeSeconds) { |
| 29 | const auto start_ts = tflite::profiling::time::NowMicros(); |
| 30 | // The following should return immediately. |
| 31 | util::SleepForSeconds(-5.0); |
| 32 | const auto end_ts = tflite::profiling::time::NowMicros(); |
| 33 | |
| 34 | // As we don't have a mocked clock, we simply expect <1 sec has elapsed, which |
| 35 | // is admittedly not quite accurate. |
| 36 | EXPECT_LT(end_ts - start_ts, 1000000); |
| 37 | } |
| 38 | |
| 39 | TEST(BenchmarkHelpersTest, SleepForSomeSeconds) { |
| 40 | const auto start_ts = tflite::profiling::time::NowMicros(); |
nothing calls this directly
no test coverage detected