From 95c06902160f2b69e098c5d5a7c90a00601a8c65 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Mon, 5 Jan 2026 18:11:02 -0600 Subject: [PATCH] Add extra time checks. --- test/time/test_time.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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) {