Skip to content

Commit

Permalink
Fixed random seed not affecting SDLTest_RandomIntegerInRange()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 1, 2024
1 parent be341bc commit df50104
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/test/SDL_test_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit df50104

Please sign in to comment.