SDL: Made the cursor list check a compile time assert instead of a runtime one

From 74418e1aa814d0023bf6679678403d9d68f97370 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 26 Dec 2023 09:57:11 -0800
Subject: [PATCH] Made the cursor list check a compile time assert instead of a
 runtime one

This will catch this being out of date more quickly in the future
---
 test/testwm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/testwm.c b/test/testwm.c
index 25b9d22f4f59..72e77ef29451 100644
--- a/test/testwm.c
+++ b/test/testwm.c
@@ -43,6 +43,8 @@ static const char *cursorNames[] = {
     "window bottom left",
     "window left"
 };
+SDL_COMPILE_TIME_ASSERT(cursorNames, SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS);
+
 static int system_cursor = -1;
 static SDL_Cursor *cursor = NULL;
 static SDL_bool relative_mode = SDL_FALSE;
@@ -266,8 +268,6 @@ int main(int argc, char *argv[])
     /* Enable standard application logging */
     SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
 
-    SDL_assert(SDL_arraysize(cursorNames) == SDL_NUM_SYSTEM_CURSORS);
-
     if (!SDLTest_CommonDefaultArgs(state, argc, argv) || !SDLTest_CommonInit(state)) {
         SDLTest_CommonQuit(state);
         return 1;