From df501040fd646a1f4eab92aa5b698b35a36013ed Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 1 Sep 2024 13:40:52 -0700
Subject: [PATCH] Fixed random seed not affecting
SDLTest_RandomIntegerInRange()
---
src/test/SDL_test_fuzzer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c
index 991e2211f3a67..94d08a81ffbf7 100644
--- a/src/test/SDL_test_fuzzer.c
+++ b/src/test/SDL_test_fuzzer.c
@@ -144,7 +144,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Sint32 range = (max - min);
SDL_assert(range < SDL_MAX_SINT32);
- return min + SDL_rand(range + 1);
+ return min + SDL_rand_r(&rndContext, range + 1);
}
/**
@@ -404,7 +404,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
float SDLTest_RandomUnitFloat(void)
{
- return SDL_randf();
+ return SDL_randf_r(&rndContext);
}
float SDLTest_RandomFloat(void)