浏览代码

test: Correct invalid enum length.

Ensure that they can't break like this again.
Eddy Jansson 3 年之前
父节点
当前提交
5c1f5a7306
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      test/testautomation_hints.c

+ 3 - 1
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 */