mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-23 21:55:12 +00:00
test_harness: Report if zero tests to run.
Fixes static analysis complain about a potential malloc(0) call.
This commit is contained in:
parent
46624b4e1d
commit
6b4bd5a759
|
@ -443,6 +443,11 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (totalNumberOfTests == 0) {
|
||||||
|
SDLTest_LogError("No tests to run?");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Pre-allocate an array for tracking failed tests (potentially all test cases) */
|
/* Pre-allocate an array for tracking failed tests (potentially all test cases) */
|
||||||
failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *));
|
failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *));
|
||||||
if (failedTests == NULL) {
|
if (failedTests == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue