Added --randmem test parameter

This commit is contained in:
Brick 2023-08-27 20:05:43 +01:00 committed by Sam Lantinga
parent ea68bb8027
commit 82e481b520
3 changed files with 66 additions and 14 deletions

View file

@ -25,6 +25,7 @@
static const char *common_usage[] = {
"[-h | --help]",
"[--trackmem]",
"[--randmem]",
"[--log all|error|system|audio|video|render|input]",
};
@ -95,7 +96,8 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags)
for (i = 1; argv[i]; ++i) {
if (SDL_strcasecmp(argv[i], "--trackmem") == 0) {
SDLTest_TrackAllocations();
break;
} else if (SDL_strcasecmp(argv[i], "--randmem") == 0) {
SDLTest_RandFillAllocations();
}
}
@ -170,6 +172,10 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
/* Already handled in SDLTest_CommonCreateState() */
return 1;
}
if (SDL_strcasecmp(argv[index], "--randmem") == 0) {
/* Already handled in SDLTest_CommonCreateState() */
return 1;
}
if (SDL_strcasecmp(argv[index], "--log") == 0) {
++index;
if (!argv[index]) {