Skip to content

Commit

Permalink
Don't fail clock check as Host timers cannot be guaranteed jitter-free
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Jan 10, 2024
1 parent 190f55a commit 30c9eb1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/HostTests/modules/Clocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ template <class Clock, typename TimeType> class ClockTestTemplate : public TestG
debug_w("Ratio: x %f", float(elapsedTicks) / (time - startTime));
uint32_t us = Micros::ticksToTime(elapsedTicks);
debug_w("Apparent time: %u", us);
#ifndef ARCH_HOST
// Up-timers may report 0 if inactive
if(endTicks != 0 || startTicks != 0) {
REQUIRE(abs(int(us - duration)) < 500); // Allow some latitude
}
#endif
}
}

Expand Down

0 comments on commit 30c9eb1

Please sign in to comment.