SDL: N3DS: Fix `-Wformat` warnings in tests.

From 6784d84c9dec5177b26f71ea6cd7ebb396a195af Mon Sep 17 00:00:00 2001
From: Pierre Wendling <[EMAIL REDACTED]>
Date: Mon, 10 Oct 2022 01:31:14 -0400
Subject: [PATCH] N3DS: Fix `-Wformat` warnings in tests.

All warnings were about invalid specifiers. Since U/Sint32 is a long,
using `%d` emits a -Wformat warning.
---
 test/checkkeysthreads.c        |  3 ++-
 test/controllermap.c           |  6 +++---
 test/testautomation_audio.c    | 10 ++++-----
 test/testautomation_guid.c     |  2 +-
 test/testautomation_keyboard.c | 26 +++++++++++------------
 test/testautomation_math.c     | 12 +++++------
 test/testautomation_mouse.c    | 16 +++++++-------
 test/testautomation_pixels.c   | 24 ++++++++++-----------
 test/testautomation_platform.c |  2 +-
 test/testautomation_rwops.c    | 28 ++++++++++++-------------
 test/testautomation_sdltest.c  | 28 ++++++++++++-------------
 test/testautomation_timer.c    | 10 ++++-----
 test/testautomation_video.c    | 10 ++++-----
 test/testgamecontroller.c      | 38 ++++++++++++++++------------------
 test/testhotplug.c             |  4 ++--
 test/testime.c                 | 17 ++++++++-------
 test/testjoystick.c            | 26 +++++++++++------------
 test/testoffscreen.c           |  6 +++---
 test/testplatform.c            |  5 +++--
 test/testrendertarget.c        |  2 +-
 test/testsem.c                 | 12 +++++------
 test/testsensor.c              | 12 +++++------
 test/testtimer.c               |  2 +-
 test/testvulkan.c              |  2 +-
 test/testwm2.c                 | 18 ++++++++--------
 test/testyuv.c                 |  2 +-
 26 files changed, 162 insertions(+), 161 deletions(-)

diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c
index 62d522609aa6..0716d0f7c01e 100644
--- a/test/checkkeysthreads.c
+++ b/test/checkkeysthreads.c
@@ -162,7 +162,8 @@ loop()
     fprintf(stderr, "starting loop\n"); fflush(stderr);
     // while (SDL_PollEvent(&event)) {
     while (!done && SDL_WaitEvent(&event)) {
-        fprintf(stderr, "got event type: %d\n", event.type); fflush(stderr);
+        fprintf(stderr, "got event type: %" SDL_PRIu32 "\n", event.type);
+        fflush(stderr);
         switch (event.type) {
         case SDL_KEYDOWN:
         case SDL_KEYUP:
diff --git a/test/controllermap.c b/test/controllermap.c
index 43bf79390326..5905b8a583fb 100644
--- a/test/controllermap.c
+++ b/test/controllermap.c
@@ -373,8 +373,8 @@ WatchJoystick(SDL_Joystick * joystick)
 
     /* Print info about the joystick we are watching */
     name = SDL_JoystickName(joystick);
-    SDL_Log("Watching joystick %d: (%s)\n", SDL_JoystickInstanceID(joystick),
-           name ? name : "Unknown Joystick");
+    SDL_Log("Watching joystick %" SDL_PRIs32 ": (%s)\n", SDL_JoystickInstanceID(joystick),
+            name ? name : "Unknown Joystick");
     SDL_Log("Joystick has %d axes, %d hats, %d balls, and %d buttons\n",
            SDL_JoystickNumAxes(joystick), SDL_JoystickNumHats(joystick),
            SDL_JoystickNumBalls(joystick), SDL_JoystickNumButtons(joystick));
@@ -781,7 +781,7 @@ main(int argc, char *argv[])
             SDL_Log("      balls: %d\n", SDL_JoystickNumBalls(joystick));
             SDL_Log("       hats: %d\n", SDL_JoystickNumHats(joystick));
             SDL_Log("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
-            SDL_Log("instance id: %d\n", SDL_JoystickInstanceID(joystick));
+            SDL_Log("instance id: %" SDL_PRIu32 "\n", SDL_JoystickInstanceID(joystick));
             SDL_Log("       guid: %s\n", guid);
             SDL_Log("    VID/PID: 0x%.4x/0x%.4x\n", SDL_JoystickGetVendor(joystick), SDL_JoystickGetProduct(joystick));
             SDL_JoystickClose(joystick);
diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c
index dd7ef3f113f4..e6127b573001 100644
--- a/test/testautomation_audio.c
+++ b/test/testautomation_audio.c
@@ -725,7 +725,7 @@ int audio_openCloseAndGetAudioStatus()
        /* Open device */
        id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
        SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device);
-       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %i", id);
+       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id);
        if (id > 1) {
 
          /* Check device audio status */
@@ -783,11 +783,11 @@ int audio_lockUnlockOpenAudioDevice()
        /* Open device */
        id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
        SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device);
-       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %i", id);
+       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >=2, got: %" SDL_PRIu32, id);
        if (id > 1) {
          /* Lock to protect callback */
          SDL_LockAudioDevice(id);
-         SDLTest_AssertPass("SDL_LockAudioDevice(%i)", id);
+         SDLTest_AssertPass("SDL_LockAudioDevice(%" SDL_PRIu32 ")", id);
 
          /* Simulate callback processing */
          SDL_Delay(10);
@@ -795,7 +795,7 @@ int audio_lockUnlockOpenAudioDevice()
 
          /* Unlock again */
          SDL_UnlockAudioDevice(id);
-         SDLTest_AssertPass("SDL_UnlockAudioDevice(%i)", id);
+         SDLTest_AssertPass("SDL_UnlockAudioDevice(%" SDL_PRIu32 ")", id);
 
          /* Close device again */
          SDL_CloseAudioDevice(id);
@@ -945,7 +945,7 @@ int audio_openCloseAudioDeviceConnected()
        /* Open device */
        id = SDL_OpenAudioDevice(device, 0, &desired, &obtained, SDL_AUDIO_ALLOW_ANY_CHANGE);
        SDLTest_AssertPass("SDL_OpenAudioDevice('%s',...)", device);
-       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %i", id);
+       SDLTest_AssertCheck(id > 1, "Validate device ID; expected: >1, got: %" SDL_PRIu32, id);
        if (id > 1) {
 
 /* TODO: enable test code when function is available in SDL2 */
diff --git a/test/testautomation_guid.c b/test/testautomation_guid.c
index 0bfedebde04d..bab2b9fd5437 100644
--- a/test/testautomation_guid.c
+++ b/test/testautomation_guid.c
@@ -108,7 +108,7 @@ TestGuidToString(void *arg)
             /* Check bytes before guid_str_buf */
             expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (fill_char << 24);
             SDL_memcpy(&actual_prefix, guid_str_buf, 4);
-            SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %i, got: %i, at size=%d", expected_prefix, actual_prefix, size);
+            SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32 ", at size=%d", expected_prefix, actual_prefix, size);
 
             /* Check that we did not overwrite too much */
             written_size = 0;
diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c
index 84a763589dfb..a83f536dda11 100644
--- a/test/testautomation_keyboard.c
+++ b/test/testautomation_keyboard.c
@@ -67,37 +67,37 @@ keyboard_getKeyFromName(void *arg)
    /* Case where Key is known, 1 character input */
    result = SDL_GetKeyFromName("A");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)");
-   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %i", SDLK_a, result);
+   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result);
 
    /* Case where Key is known, 2 character input */
    result = SDL_GetKeyFromName("F1");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/double)");
-   SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %i", SDLK_F1, result);
+   SDLTest_AssertCheck(result == SDLK_F1, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_F1, result);
 
    /* Case where Key is known, 3 character input */
    result = SDL_GetKeyFromName("End");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/triple)");
-   SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %i", SDLK_END, result);
+   SDLTest_AssertCheck(result == SDLK_END, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_END, result);
 
    /* Case where Key is known, 4 character input */
    result = SDL_GetKeyFromName("Find");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/quad)");
-   SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %i", SDLK_FIND, result);
+   SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_FIND, result);
 
    /* Case where Key is known, multiple character input */
    result = SDL_GetKeyFromName("AudioStop");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/multi)");
-   SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %i", SDLK_AUDIOSTOP, result);
+   SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_AUDIOSTOP, result);
 
    /* Case where Key is unknown */
    result = SDL_GetKeyFromName("NotThere");
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(unknown)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
 
    /* Case where input is NULL/invalid */
    result = SDL_GetKeyFromName(NULL);
    SDLTest_AssertPass("Call to SDL_GetKeyFromName(NULL)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
 
    return TEST_COMPLETED;
 }
@@ -134,12 +134,12 @@ keyboard_getKeyFromScancode(void *arg)
    /* Case where input is valid */
    result = SDL_GetKeyFromScancode(SDL_SCANCODE_A);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)");
-   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %i", SDLK_a, result);
+   SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %i, got: %" SDL_PRIs32, SDLK_a, result);
 
    /* Case where input is zero */
    result = SDL_GetKeyFromScancode(0);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
 
    /* Clear error message */
    SDL_ClearError();
@@ -148,13 +148,13 @@ keyboard_getKeyFromScancode(void *arg)
    /* Case where input is invalid (too small) */
    result = SDL_GetKeyFromScancode(-999);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
    _checkInvalidScancodeError();
 
    /* Case where input is invalid (too big) */
    result = SDL_GetKeyFromScancode(999);
    SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)");
-   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %i", SDLK_UNKNOWN, result);
+   SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %i, got: %" SDL_PRIs32, SDLK_UNKNOWN, result);
    _checkInvalidScancodeError();
 
    return TEST_COMPLETED;
@@ -258,7 +258,7 @@ keyboard_getKeyNameNegative(void *arg)
    /* Unknown keycode */
    keycode = SDLK_UNKNOWN;
    result = (char *)SDL_GetKeyName(keycode);
-   SDLTest_AssertPass("Call to SDL_GetKeyName(%d/unknown)", keycode);
+   SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/unknown)", keycode);
    SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
    SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
 
@@ -269,7 +269,7 @@ keyboard_getKeyNameNegative(void *arg)
    /* Negative keycode */
    keycode = (SDL_Keycode)SDLTest_RandomIntegerInRange(-255, -1);
    result = (char *)SDL_GetKeyName(keycode);
-   SDLTest_AssertPass("Call to SDL_GetKeyName(%d/negative)", keycode);
+   SDLTest_AssertPass("Call to SDL_GetKeyName(%" SDL_PRIs32 "/negative)", keycode);
    SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL");
    SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: '%s', got: '%s'", expected, result);
    _checkInvalidScancodeError();
diff --git a/test/testautomation_math.c b/test/testautomation_math.c
index eee05dab2f87..bdf5703a293a 100644
--- a/test/testautomation_math.c
+++ b/test/testautomation_math.c
@@ -183,7 +183,7 @@ helper_range(const char *func_name, d_to_d_func func)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("%s: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("%s: Testing a range of %u values with steps of %" SDL_PRIu32,
                        func_name,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
@@ -770,7 +770,7 @@ copysign_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Copysign: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Copysign: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -973,7 +973,7 @@ fmod_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Fmod: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Fmod: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -1684,7 +1684,7 @@ pow_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Pow: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Pow: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -2011,7 +2011,7 @@ cos_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Cos: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Cos: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
@@ -2129,7 +2129,7 @@ sin_rangeTest(void *args)
     Uint32 i;
     double test_value = 0.0;
 
-    SDLTest_AssertPass("Sin: Testing a range of %u values with steps of %u",
+    SDLTest_AssertPass("Sin: Testing a range of %u values with steps of %" SDL_PRIu32,
                        RANGE_TEST_ITERATIONS,
                        RANGE_TEST_STEP);
 
diff --git a/test/testautomation_mouse.c b/test/testautomation_mouse.c
index b9e74cb355be..f8334803ea21 100644
--- a/test/testautomation_mouse.c
+++ b/test/testautomation_mouse.c
@@ -41,21 +41,21 @@ mouse_getMouseState(void *arg)
    /* Case where x, y pointer is NULL */
    state = SDL_GetMouseState(NULL, NULL);
    SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, NULL)");
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x pointer is not NULL */
    x = INT_MIN;
    state = SDL_GetMouseState(&x, NULL);
    SDLTest_AssertPass("Call to SDL_GetMouseState(&x, NULL)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where y pointer is not NULL */
    y = INT_MIN;
    state = SDL_GetMouseState(NULL, &y);
    SDLTest_AssertPass("Call to SDL_GetMouseState(NULL, &y)");
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x and y pointer is not NULL */
    x = INT_MIN;
@@ -64,7 +64,7 @@ mouse_getMouseState(void *arg)
    SDLTest_AssertPass("Call to SDL_GetMouseState(&x, &y)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    return TEST_COMPLETED;
 }
@@ -87,21 +87,21 @@ mouse_getRelativeMouseState(void *arg)
    /* Case where x, y pointer is NULL */
    state = SDL_GetRelativeMouseState(NULL, NULL);
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, NULL)");
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x pointer is not NULL */
    x = INT_MIN;
    state = SDL_GetRelativeMouseState(&x, NULL);
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, NULL)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where y pointer is not NULL */
    y = INT_MIN;
    state = SDL_GetRelativeMouseState(NULL, &y);
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(NULL, &y)");
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    /* Case where x and y pointer is not NULL */
    x = INT_MIN;
@@ -110,7 +110,7 @@ mouse_getRelativeMouseState(void *arg)
    SDLTest_AssertPass("Call to SDL_GetRelativeMouseState(&x, &y)");
    SDLTest_AssertCheck(x > INT_MIN, "Validate that value of x is > INT_MIN, got: %i", x);
    SDLTest_AssertCheck(y > INT_MIN, "Validate that value of y is > INT_MIN, got: %i", y);
-   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %u", state);
+   SDLTest_AssertCheck(_mouseStateCheck(state), "Validate state returned from function, got: %" SDL_PRIu32, state);
 
    return TEST_COMPLETED;
 }
diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c
index 0f6870c9a597..63b177f18f4b 100644
--- a/test/testautomation_pixels.c
+++ b/test/testautomation_pixels.c
@@ -137,18 +137,18 @@ pixels_allocFreeFormat(void *arg)
 
   /* Blank/unknown format */
   format = 0;
-  SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
+  SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
 
   /* Allocate format */
   result = SDL_AllocFormat(format);
   SDLTest_AssertPass("Call to SDL_AllocFormat()");
   SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
   if (result != NULL) {
-    SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
+    SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
     SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel);
     SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel);
     masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
-    SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %u", masks);
+    SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %" SDL_PRIu32, masks);
 
     /* Deallocate again */
     SDL_FreeFormat(result);
@@ -158,19 +158,19 @@ pixels_allocFreeFormat(void *arg)
   /* RGB formats */
   for (i = 0; i < _numRGBPixelFormats; i++) {
     format = _RGBPixelFormats[i];
-    SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
 
     /* Allocate format */
     result = SDL_AllocFormat(format);
     SDLTest_AssertPass("Call to SDL_AllocFormat()");
     SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
     if (result != NULL) {
-      SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
+      SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
       SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);
       SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);
       if (result->palette != NULL) {
          masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
-         SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks);
+         SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks);
       }
 
       /* Deallocate again */
@@ -182,7 +182,7 @@ pixels_allocFreeFormat(void *arg)
   /* Non-RGB formats */
   for (i = 0; i < _numNonRGBPixelFormats; i++) {
     format = _nonRGBPixelFormats[i];
-    SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
 
     /* Try to allocate format */
     result = SDL_AllocFormat(format);
@@ -198,7 +198,7 @@ pixels_allocFreeFormat(void *arg)
     SDLTest_AssertPass("Call to SDL_ClearError()");
     format = _invalidPixelFormats[i];
     result = SDL_AllocFormat(format);
-    SDLTest_AssertPass("Call to SDL_AllocFormat(%u)", format);
+    SDLTest_AssertPass("Call to SDL_AllocFormat(%" SDL_PRIu32 ")", format);
     SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
     error = SDL_GetError();
     SDLTest_AssertPass("Call to SDL_GetError()");
@@ -241,7 +241,7 @@ pixels_getPixelFormatName(void *arg)
 
   /* Blank/undefined format */
   format = 0;
-  SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
+  SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
 
   /* Get name of format */
   result = SDL_GetPixelFormatName(format);
@@ -256,7 +256,7 @@ pixels_getPixelFormatName(void *arg)
   /* RGB formats */
   for (i = 0; i < _numRGBPixelFormats; i++) {
     format = _RGBPixelFormats[i];
-    SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
 
     /* Get name of format */
     result = SDL_GetPixelFormatName(format);
@@ -272,7 +272,7 @@ pixels_getPixelFormatName(void *arg)
   /* Non-RGB formats */
   for (i = 0; i < _numNonRGBPixelFormats; i++) {
     format = _nonRGBPixelFormats[i];
-    SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
+    SDLTest_Log("non-RGB Format: %s (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
 
     /* Get name of format */
     result = SDL_GetPixelFormatName(format);
@@ -293,7 +293,7 @@ pixels_getPixelFormatName(void *arg)
   for (i = 0; i < _numInvalidPixelFormats; i++) {
     format = _invalidPixelFormats[i];
     result = SDL_GetPixelFormatName(format);
-    SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%u)", format);
+    SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%" SDL_PRIu32 ")", format);
     SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
     if (result != NULL) {
       SDLTest_AssertCheck(result[0] != '\0',
diff --git a/test/testautomation_platform.c b/test/testautomation_platform.c
index 0b37dd9314ec..e8661488481a 100644
--- a/test/testautomation_platform.c
+++ b/test/testautomation_platform.c
@@ -106,7 +106,7 @@ int platform_testEndianessAndSwap(void *arg)
 
     /* Test 32 swap. */
     SDLTest_AssertCheck( SDL_Swap32(value32) == swapped32,
-             "SDL_Swap32(): 32 bit swapped: 0x%X => 0x%X",
+             "SDL_Swap32(): 32 bit swapped: 0x%" SDL_PRIX32 " => 0x%" SDL_PRIX32,
              value32, SDL_Swap32(value32) );
 
     /* Test 64 swap. */
diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c
index f2d5627e5b46..16d5407520e4 100644
--- a/test/testautomation_rwops.c
+++ b/test/testautomation_rwops.c
@@ -239,7 +239,7 @@ rwops_testMem (void)
    if (rw == NULL) return TEST_ABORTED;
 
    /* Check type */
-   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY, "Verify RWops type is SDL_RWOPS_MEMORY; expected: %d, got: %d", SDL_RWOPS_MEMORY, rw->type);
+   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY, "Verify RWops type is SDL_RWOPS_MEMORY; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations(rw, 1);
@@ -275,7 +275,7 @@ rwops_testConstMem (void)
    if (rw == NULL) return TEST_ABORTED;
 
    /* Check type */
-   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY_RO, "Verify RWops type is SDL_RWOPS_MEMORY_RO; expected: %d, got: %d", SDL_RWOPS_MEMORY_RO, rw->type);
+   SDLTest_AssertCheck(rw->type == SDL_RWOPS_MEMORY_RO, "Verify RWops type is SDL_RWOPS_MEMORY_RO; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_MEMORY_RO, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations( rw, 0 );
@@ -321,8 +321,8 @@ rwops_testFileRead(void)
       "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type);
 #else
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 #endif
 
    /* Run generic tests */
@@ -368,8 +368,8 @@ rwops_testFileWrite(void)
       "Verify RWops type is SDL_RWOPS_WINFILE; expected: %d, got: %d", SDL_RWOPS_WINFILE, rw->type);
 #else
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 #endif
 
    /* Run generic tests */
@@ -420,8 +420,8 @@ rwops_testFPRead(void)
 
    /* Check type */
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations( rw, 0 );
@@ -473,8 +473,8 @@ rwops_testFPWrite(void)
 
    /* Check type */
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_STDFILE,
-      "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %d", SDL_RWOPS_STDFILE, rw->type);
+       rw->type == SDL_RWOPS_STDFILE,
+       "Verify RWops type is SDL_RWOPS_STDFILE; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_STDFILE, rw->type);
 
    /* Run generic tests */
    _testGenericRWopsValidations( rw, 1 );
@@ -506,8 +506,8 @@ rwops_testAllocFree (void)
 
    /* Check type */
    SDLTest_AssertCheck(
-      rw->type == SDL_RWOPS_UNKNOWN,
-      "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %d", SDL_RWOPS_UNKNOWN, rw->type);
+       rw->type == SDL_RWOPS_UNKNOWN,
+       "Verify RWops type is SDL_RWOPS_UNKNOWN; expected: %d, got: %" SDL_PRIu32, SDL_RWOPS_UNKNOWN, rw->type);
 
    /* Free context again */
    SDL_FreeRW(rw);
@@ -684,7 +684,7 @@ rwops_testFileWriteReadEndian(void)
      SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test);
      BE32test = SDL_ReadBE32(rw);
      SDLTest_AssertPass("Call to SDL_ReadBE32()");
-     SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test);
+     SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, BE32value, BE32test);
      BE64test = SDL_ReadBE64(rw);
      SDLTest_AssertPass("Call to SDL_ReadBE64()");
      SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, BE64value, BE64test);
@@ -693,7 +693,7 @@ rwops_testFileWriteReadEndian(void)
      SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test);
      LE32test = SDL_ReadLE32(rw);
      SDLTest_AssertPass("Call to SDL_ReadLE32()");
-     SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test);
+     SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, LE32value, LE32test);
      LE64test = SDL_ReadLE64(rw);
      SDLTest_AssertPass("Call to SDL_ReadLE64()");
      SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %"SDL_PRIu64", got: %"SDL_PRIu64, LE64value, LE64test);
diff --git a/test/testautomation_sdltest.c b/test/testautomation_sdltest.c
index 809664dc3443..9c97e60137b1 100644
--- a/test/testautomation_sdltest.c
+++ b/test/testautomation_sdltest.c
@@ -891,8 +891,8 @@ sdltest_randomBoundaryNumberSint32(void *arg)
   sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE);
   SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
   SDLTest_AssertCheck(
-    sresult == long_min,
-    "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
+      sresult == long_min,
+      "Validate result v

(Patch may be truncated, please check the link at the top of this post.)