From 7389eba94327cda148e700b2a9a38dca1b6e9ba9 Mon Sep 17 00:00:00 2001 From: Pierre Wendling Date: Wed, 4 May 2022 12:49:25 -0400 Subject: [PATCH] Test: Fix C89 declaration and math include. --- test/testautomation_math.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/testautomation_math.c b/test/testautomation_math.c index ab8213f2d..26a85be65 100644 --- a/test/testautomation_math.c +++ b/test/testautomation_math.c @@ -2,6 +2,8 @@ * Math test suite */ +#include + #include "SDL.h" #include "SDL_test.h" @@ -76,12 +78,13 @@ static int floor_rangeTest(void* args) { SDLTest_AssertPass("Floor: Testing a range of %u values with %u steps", ITERATIONS, STEP); for (Uint32 i = 0; i < ITERATIONS; i++, test_value += STEP) { + double result; /* These are tested elsewhere */ if (isnan(test_value) || isinf(test_value)) { continue; } - const double result = SDL_floor(test_value); + result = SDL_floor(test_value); if (result != test_value) { /* Only log failures to save performances */ SDLTest_AssertPass("Floor(%.1f), expected %.1f, got %.1f", test_value, test_value, result);