diff --git a/test/time/test_time.c b/test/time/test_time.c index e8f3869..f5df52e 100644 --- a/test/time/test_time.c +++ b/test/time/test_time.c @@ -111,6 +111,17 @@ static void test_timeUpdate(void **state) { assert_float_equal(TIME.dynamicTime, TIME_STEP + 0.104f, 0.0001f); assert_float_equal(TIME.delta, TIME_STEP, 0.0001f); assert_float_equal(TIME.time, TIME_STEP * 5, 0.0001f); + + // Time can stand still if needed + SDL_GETTICKS_CALLED = false; + SDL_GETTICKS_TICKS = 104; // No time elapsed + timeUpdate(); + assert_true(SDL_GETTICKS_CALLED); + + // Time cannot go backwards + SDL_GETTICKS_TICKS = 90; + SDL_GETTICKS_CALLED = false; + expect_assert_failure(timeUpdate()); } int main(int argc, char **argv) {