fix border case in test definition

there was the possibility for the random offset added in this test
to add up to a whole frame, which would cause the
re-quantisation to wrap to the next fame (and thus the
CHECK in line 110 to fail.
This commit is contained in:
Fischlurch 2013-02-13 04:53:15 +01:00
parent 25be40bb4a
commit d8d4db3544

View file

@ -103,8 +103,10 @@ namespace test {
Time point (myGrid->timeOf (randomFrame));
CHECK (point == testOrigin + randomFrame * testFps.duration());
uint fract = 1 + rand() % DIRT_GRAIN;
uint fract = 2 + rand() % DIRT_GRAIN;
FSecs dirt = rational_cast<FSecs> (1 / testFps / fract);
ASSERT (Time(dirt) < testFps.duration());
ASSERT (0 < dirt);
Time dirty(point + Time(dirt));
CHECK (point == testOrigin + myGrid->gridAlign(dirty));