docs: say that HrtRateFit::toSeconds returns producer-epoch, not wall, seconds
The fit keeps the slope and discards the intercept, so the result counts from the producer's boot. Tasks 4 and 7 compose it with ClockOffset::map, which is correct, but the bare name invites passing it straight to a plot axis. Also unwrapped the stalled-clock assertion from behind `if (fit.ready())` — that branch never runs, so the test confirmed nothing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e4817dd284
commit
c89decef8e
@@ -102,10 +102,12 @@ TEST(HrtRateFit, SurvivesAStalledClock) {
|
||||
for (int i = 0; i < 64; i++) {
|
||||
fit.add(12345u, 1000.0 + i * 0.01); /* hrt never advances */
|
||||
}
|
||||
/* A degenerate fit must not produce a rate that would divide by zero. */
|
||||
if (fit.ready()) {
|
||||
EXPECT_GT(fit.ticksPerSecond(), 0.0);
|
||||
}
|
||||
/* A degenerate fit must not produce a rate that would divide by zero, so it
|
||||
* must decline to be ready at all. Guarding this behind `if (fit.ready())`
|
||||
* would make the test vacuous: the branch never runs and a fit that
|
||||
* declared itself ready with a rate of 0 or NaN would pass unnoticed. */
|
||||
EXPECT_FALSE(fit.ready());
|
||||
EXPECT_DOUBLE_EQ(fit.ticksPerSecond(), 0.0);
|
||||
}
|
||||
|
||||
TEST(TimeSignalScale, UsesNanosecondsForUint64AndMicrosecondsOtherwise) {
|
||||
|
||||
Reference in New Issue
Block a user