From 5c1f5a73069de5b325aca444e7e745d3f2ad3dd5 Mon Sep 17 00:00:00 2001 From: Eddy Jansson Date: Thu, 28 Apr 2022 20:57:20 +0200 Subject: [PATCH] test: Correct invalid enum length. Ensure that they can't break like this again. --- test/testautomation_hints.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/testautomation_hints.c b/test/testautomation_hints.c index a11f8e47b..91b8c02ab 100644 --- a/test/testautomation_hints.c +++ b/test/testautomation_hints.c @@ -8,7 +8,6 @@ #include "SDL_test.h" -const int _numHintsEnum = 25; const char* _HintsEnum[] = { SDL_HINT_ACCELEROMETER_AS_JOYSTICK, @@ -62,6 +61,9 @@ const char* _HintsVerbose[] = "SDL_XINPUT_ENABLED" }; +SDL_COMPILE_TIME_ASSERT(HintsEnum, SDL_arraysize(_HintsEnum) == SDL_arraysize(_HintsVerbose)); + +const int _numHintsEnum = SDL_arraysize(_HintsEnum); /* Test case functions */