From d8d4db354403ee25df8e974dada46b20c7fe4d97 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 13 Feb 2013 04:53:15 +0100 Subject: [PATCH] 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. --- tests/core/proc/asset/meta/time-grid-basics-test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/core/proc/asset/meta/time-grid-basics-test.cpp b/tests/core/proc/asset/meta/time-grid-basics-test.cpp index e90eb794a..8833036e5 100644 --- a/tests/core/proc/asset/meta/time-grid-basics-test.cpp +++ b/tests/core/proc/asset/meta/time-grid-basics-test.cpp @@ -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 (1 / testFps / fract); + ASSERT (Time(dirt) < testFps.duration()); + ASSERT (0 < dirt); Time dirty(point + Time(dirt)); CHECK (point == testOrigin + myGrid->gridAlign(dirty));