remove most of SDL_OutOfMemory() calls where SDL is the allocator.

Since commit 447b508a77, SDL_malloc,
SDL_calloc, and SDL_realloc already calls SDL_OutOfMemory().
This commit is contained in:
Ozkan Sezer 2024-05-08 19:33:04 +03:00 committed by Ozkan Sezer
parent 7abc589438
commit e909c0360f
15 changed files with 21 additions and 57 deletions

View file

@ -76,7 +76,6 @@ char *SDLTest_GenerateRunSeed(const int length)
seed = (char *)SDL_malloc((length + 1) * sizeof(char));
if (!seed) {
SDLTest_LogError("SDL_malloc for run seed output buffer failed.");
SDL_OutOfMemory();
return NULL;
}
@ -151,7 +150,6 @@ static Uint64 SDLTest_GenerateExecKey(const char *runSeed, const char *suiteName
buffer = (char *)SDL_malloc(entireStringLength);
if (!buffer) {
SDLTest_LogError("Failed to allocate buffer for execKey generation.");
SDL_OutOfMemory();
return 0;
}
(void)SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration);
@ -457,7 +455,6 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *));
if (!failedTests) {
SDLTest_LogError("Unable to allocate cache for failed tests");
SDL_OutOfMemory();
return -1;
}