From 490f7af92b958c52a920fbc313c5568d3c7550d7 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 3 Aug 2024 18:20:26 -0700
Subject: [PATCH] Removed test that triggers an asan overflow warning
Fixes https://github.com/libsdl-org/SDL/issues/8884
---
test/testautomation_sdltest.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/testautomation_sdltest.c b/test/testautomation_sdltest.c
index 1f29c07308b92..a9b04c6c17268 100644
--- a/test/testautomation_sdltest.c
+++ b/test/testautomation_sdltest.c
@@ -1059,12 +1059,14 @@ static int sdltest_randomIntegerInRange(void *arg)
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)");
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
+#if 0 /* This test correctly triggers an asan warning: runtime error: signed integer overflow: 2147483647 + 4239 cannot be represented in type 'int' */
/* Range with min at integer limit */
min = long_min;
max = long_max + (Sint32)SDLTest_RandomSint16();
result = SDLTest_RandomIntegerInRange(min, max);
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)");
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result);
+#endif
/* Range with max at integer limit */
min = long_min - (Sint32)SDLTest_RandomSint16();