Do case insensitive matching on test cases

main
Sam Lantinga 2022-09-19 14:37:10 -07:00
parent 3b20e0ecef
commit 101306edcf
1 changed files with 4 additions and 4 deletions

View File

@ -463,7 +463,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
while (testSuites[suiteCounter] && suiteFilter == 0) { while (testSuites[suiteCounter] && suiteFilter == 0) {
testSuite = testSuites[suiteCounter]; testSuite = testSuites[suiteCounter];
suiteCounter++; suiteCounter++;
if (testSuite->name != NULL && SDL_strcmp(filter, testSuite->name) == 0) { if (testSuite->name != NULL && SDL_strcasecmp(filter, testSuite->name) == 0) {
/* Matched a suite name */ /* Matched a suite name */
suiteFilter = 1; suiteFilter = 1;
suiteFilterName = testSuite->name; suiteFilterName = testSuite->name;
@ -476,7 +476,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
while (testSuite->testCases[testCounter] && testFilter == 0) { while (testSuite->testCases[testCounter] && testFilter == 0) {
testCase = testSuite->testCases[testCounter]; testCase = testSuite->testCases[testCounter];
testCounter++; testCounter++;
if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) { if (testCase->name != NULL && SDL_strcasecmp(filter, testCase->name) == 0) {
/* Matched a test name */ /* Matched a test name */
suiteFilter = 1; suiteFilter = 1;
suiteFilterName = testSuite->name; suiteFilterName = testSuite->name;
@ -517,7 +517,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
/* Filter suite if flag set and we have a name */ /* Filter suite if flag set and we have a name */
if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL && if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL &&
SDL_strcmp(suiteFilterName, testSuite->name) != 0) { SDL_strcasecmp(suiteFilterName, testSuite->name) != 0) {
/* Skip suite */ /* Skip suite */
SDLTest_Log("===== Test Suite %i: '%s' skipped\n", SDLTest_Log("===== Test Suite %i: '%s' skipped\n",
suiteCounter, suiteCounter,
@ -547,7 +547,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
/* Filter tests if flag set and we have a name */ /* Filter tests if flag set and we have a name */
if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL && if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL &&
SDL_strcmp(testFilterName, testCase->name) != 0) { SDL_strcasecmp(testFilterName, testCase->name) != 0) {
/* Skip test */ /* Skip test */
SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n", SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n",
suiteCounter, suiteCounter,