diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index 3a1f432b0..ec67d9977 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -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) */ failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *)); if (failedTests == NULL) {