src/test/SDL_test_harness.c
changeset 7191 75360622e65f
parent 7189 414be1d64060
child 7678 286c42d7c5ed
     1.1 --- a/src/test/SDL_test_harness.c	Sat May 18 12:48:50 2013 -0700
     1.2 +++ b/src/test/SDL_test_harness.c	Sat May 18 14:17:52 2013 -0700
     1.3 @@ -53,45 +53,45 @@
     1.4  char *
     1.5  SDLTest_GenerateRunSeed(const int length)
     1.6  {
     1.7 -	char *seed = NULL;
     1.8 -	SDLTest_RandomContext randomContext;
     1.9 -	int counter;
    1.10 +    char *seed = NULL;
    1.11 +    SDLTest_RandomContext randomContext;
    1.12 +    int counter;
    1.13  
    1.14 -	/* Sanity check input */
    1.15 -	if (length <= 0) {
    1.16 -		SDLTest_LogError("The length of the harness seed must be >0.");
    1.17 -		return NULL;
    1.18 -	}
    1.19 +    /* Sanity check input */
    1.20 +    if (length <= 0) {
    1.21 +        SDLTest_LogError("The length of the harness seed must be >0.");
    1.22 +        return NULL;
    1.23 +    }
    1.24  
    1.25 -	/* Allocate output buffer */
    1.26 -	seed = (char *)SDL_malloc((length + 1) * sizeof(char));
    1.27 -	if (seed == NULL) {
    1.28 -		SDLTest_LogError("SDL_malloc for run seed output buffer failed.");
    1.29 -		return NULL;
    1.30 -	}
    1.31 +    /* Allocate output buffer */
    1.32 +    seed = (char *)SDL_malloc((length + 1) * sizeof(char));
    1.33 +    if (seed == NULL) {
    1.34 +        SDLTest_LogError("SDL_malloc for run seed output buffer failed.");
    1.35 +        return NULL;
    1.36 +    }
    1.37  
    1.38 -	/* Generate a random string of alphanumeric characters */
    1.39 -	SDLTest_RandomInitTime(&randomContext);
    1.40 -	for (counter = 0; counter < length - 1; ++counter) {
    1.41 -		unsigned int number = SDLTest_Random(&randomContext);
    1.42 -		char ch = (char) (number % (91 - 48)) + 48;
    1.43 -		if (ch >= 58 && ch <= 64) {
    1.44 -			ch = 65;
    1.45 -		}
    1.46 -		seed[counter] = ch;
    1.47 -	}
    1.48 -	seed[counter] = '\0';
    1.49 +    /* Generate a random string of alphanumeric characters */
    1.50 +    SDLTest_RandomInitTime(&randomContext);
    1.51 +    for (counter = 0; counter < length - 1; ++counter) {
    1.52 +        unsigned int number = SDLTest_Random(&randomContext);
    1.53 +        char ch = (char) (number % (91 - 48)) + 48;
    1.54 +        if (ch >= 58 && ch <= 64) {
    1.55 +            ch = 65;
    1.56 +        }
    1.57 +        seed[counter] = ch;
    1.58 +    }
    1.59 +    seed[counter] = '\0';
    1.60  
    1.61 -	return seed;
    1.62 +    return seed;
    1.63  }
    1.64  
    1.65  /**
    1.66  * Generates an execution key for the fuzzer.
    1.67  *
    1.68 -* \param runSeed		The run seed to use
    1.69 -* \param suiteName		The name of the test suite
    1.70 -* \param testName		The name of the test
    1.71 -* \param iteration		The iteration count
    1.72 +* \param runSeed        The run seed to use
    1.73 +* \param suiteName      The name of the test suite
    1.74 +* \param testName       The name of the test
    1.75 +* \param iteration      The iteration count
    1.76  *
    1.77  * \returns The generated execution key to initialize the fuzzer with.
    1.78  *
    1.79 @@ -99,61 +99,61 @@
    1.80  Uint64
    1.81  SDLTest_GenerateExecKey(char *runSeed, char *suiteName, char *testName, int iteration)
    1.82  {
    1.83 -	SDLTest_Md5Context md5Context;
    1.84 -	Uint64 *keys;
    1.85 -	char iterationString[16];
    1.86 -	Uint32 runSeedLength;
    1.87 -	Uint32 suiteNameLength;
    1.88 -	Uint32 testNameLength;
    1.89 -	Uint32 iterationStringLength;
    1.90 -	Uint32 entireStringLength;
    1.91 -	char *buffer;
    1.92 +    SDLTest_Md5Context md5Context;
    1.93 +    Uint64 *keys;
    1.94 +    char iterationString[16];
    1.95 +    Uint32 runSeedLength;
    1.96 +    Uint32 suiteNameLength;
    1.97 +    Uint32 testNameLength;
    1.98 +    Uint32 iterationStringLength;
    1.99 +    Uint32 entireStringLength;
   1.100 +    char *buffer;
   1.101  
   1.102 -	if (runSeed == NULL || SDL_strlen(runSeed)==0) {
   1.103 -		SDLTest_LogError("Invalid runSeed string.");
   1.104 -		return -1;
   1.105 -	}
   1.106 +    if (runSeed == NULL || SDL_strlen(runSeed)==0) {
   1.107 +        SDLTest_LogError("Invalid runSeed string.");
   1.108 +        return -1;
   1.109 +    }
   1.110  
   1.111 -	if (suiteName == NULL || SDL_strlen(suiteName)==0) {
   1.112 -		SDLTest_LogError("Invalid suiteName string.");
   1.113 -		return -1;
   1.114 -	}
   1.115 +    if (suiteName == NULL || SDL_strlen(suiteName)==0) {
   1.116 +        SDLTest_LogError("Invalid suiteName string.");
   1.117 +        return -1;
   1.118 +    }
   1.119  
   1.120 -	if (testName == NULL || SDL_strlen(testName)==0) {
   1.121 -		SDLTest_LogError("Invalid testName string.");
   1.122 -		return -1;
   1.123 -	}
   1.124 +    if (testName == NULL || SDL_strlen(testName)==0) {
   1.125 +        SDLTest_LogError("Invalid testName string.");
   1.126 +        return -1;
   1.127 +    }
   1.128  
   1.129 -	if (iteration <= 0) {
   1.130 -		SDLTest_LogError("Invalid iteration count.");
   1.131 -		return -1;
   1.132 -	}
   1.133 +    if (iteration <= 0) {
   1.134 +        SDLTest_LogError("Invalid iteration count.");
   1.135 +        return -1;
   1.136 +    }
   1.137  
   1.138 -	/* Convert iteration number into a string */
   1.139 -	SDL_memset(iterationString, 0, sizeof(iterationString));
   1.140 -	SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iteration);
   1.141 +    /* Convert iteration number into a string */
   1.142 +    SDL_memset(iterationString, 0, sizeof(iterationString));
   1.143 +    SDL_snprintf(iterationString, sizeof(iterationString) - 1, "%d", iteration);
   1.144  
   1.145 -	/* Combine the parameters into single string */
   1.146 -	runSeedLength = SDL_strlen(runSeed);
   1.147 -	suiteNameLength = SDL_strlen(suiteName);
   1.148 -	testNameLength = SDL_strlen(testName);
   1.149 -	iterationStringLength = SDL_strlen(iterationString);
   1.150 -	entireStringLength  = runSeedLength + suiteNameLength + testNameLength + iterationStringLength + 1;
   1.151 -	buffer = (char *)SDL_malloc(entireStringLength);
   1.152 -	if (buffer == NULL) {
   1.153 -		SDLTest_LogError("SDL_malloc failed to allocate buffer for execKey generation.");
   1.154 -		return 0;
   1.155 -	}
   1.156 -	SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration);
   1.157 +    /* Combine the parameters into single string */
   1.158 +    runSeedLength = SDL_strlen(runSeed);
   1.159 +    suiteNameLength = SDL_strlen(suiteName);
   1.160 +    testNameLength = SDL_strlen(testName);
   1.161 +    iterationStringLength = SDL_strlen(iterationString);
   1.162 +    entireStringLength  = runSeedLength + suiteNameLength + testNameLength + iterationStringLength + 1;
   1.163 +    buffer = (char *)SDL_malloc(entireStringLength);
   1.164 +    if (buffer == NULL) {
   1.165 +        SDLTest_LogError("SDL_malloc failed to allocate buffer for execKey generation.");
   1.166 +        return 0;
   1.167 +    }
   1.168 +    SDL_snprintf(buffer, entireStringLength, "%s%s%s%d", runSeed, suiteName, testName, iteration);
   1.169  
   1.170 -	/* Hash string and use half of the digest as 64bit exec key */
   1.171 -	SDLTest_Md5Init(&md5Context);
   1.172 -	SDLTest_Md5Update(&md5Context, (unsigned char *)buffer, entireStringLength);
   1.173 -	SDLTest_Md5Final(&md5Context);
   1.174 -	SDL_free(buffer);
   1.175 -	keys = (Uint64 *)md5Context.digest;
   1.176 +    /* Hash string and use half of the digest as 64bit exec key */
   1.177 +    SDLTest_Md5Init(&md5Context);
   1.178 +    SDLTest_Md5Update(&md5Context, (unsigned char *)buffer, entireStringLength);
   1.179 +    SDLTest_Md5Final(&md5Context);
   1.180 +    SDL_free(buffer);
   1.181 +    keys = (Uint64 *)md5Context.digest;
   1.182  
   1.183 -	return keys[0];
   1.184 +    return keys[0];
   1.185  }
   1.186  
   1.187  /**
   1.188 @@ -163,52 +163,52 @@
   1.189  *
   1.190  * \param timeout Timeout interval in seconds.
   1.191  * \param callback Function that will be called after timeout has elapsed.
   1.192 -* 
   1.193 +*
   1.194  * \return Timer id or -1 on failure.
   1.195  */
   1.196  SDL_TimerID
   1.197  SDLTest_SetTestTimeout(int timeout, void (*callback)())
   1.198  {
   1.199 -	Uint32 timeoutInMilliseconds;
   1.200 -	SDL_TimerID timerID;
   1.201 +    Uint32 timeoutInMilliseconds;
   1.202 +    SDL_TimerID timerID;
   1.203  
   1.204 -	if (callback == NULL) {
   1.205 -		SDLTest_LogError("Timeout callback can't be NULL");
   1.206 -		return -1;
   1.207 -	}
   1.208 +    if (callback == NULL) {
   1.209 +        SDLTest_LogError("Timeout callback can't be NULL");
   1.210 +        return -1;
   1.211 +    }
   1.212  
   1.213 -	if (timeout < 0) {
   1.214 -		SDLTest_LogError("Timeout value must be bigger than zero.");
   1.215 -		return -1;
   1.216 -	}
   1.217 +    if (timeout < 0) {
   1.218 +        SDLTest_LogError("Timeout value must be bigger than zero.");
   1.219 +        return -1;
   1.220 +    }
   1.221  
   1.222 -	/* Init SDL timer if not initialized before */
   1.223 -	if (SDL_WasInit(SDL_INIT_TIMER) == 0) {
   1.224 -		if (SDL_InitSubSystem(SDL_INIT_TIMER)) {
   1.225 -			SDLTest_LogError("Failed to init timer subsystem: %s", SDL_GetError());
   1.226 -			return -1;
   1.227 -		}
   1.228 -	}
   1.229 +    /* Init SDL timer if not initialized before */
   1.230 +    if (SDL_WasInit(SDL_INIT_TIMER) == 0) {
   1.231 +        if (SDL_InitSubSystem(SDL_INIT_TIMER)) {
   1.232 +            SDLTest_LogError("Failed to init timer subsystem: %s", SDL_GetError());
   1.233 +            return -1;
   1.234 +        }
   1.235 +    }
   1.236  
   1.237 -	/* Set timer */
   1.238 -	timeoutInMilliseconds = timeout * 1000;
   1.239 -	timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback)callback, 0x0);
   1.240 -	if (timerID == 0) {
   1.241 -		SDLTest_LogError("Creation of SDL timer failed: %s", SDL_GetError());
   1.242 -		return -1;
   1.243 -	}
   1.244 +    /* Set timer */
   1.245 +    timeoutInMilliseconds = timeout * 1000;
   1.246 +    timerID = SDL_AddTimer(timeoutInMilliseconds, (SDL_TimerCallback)callback, 0x0);
   1.247 +    if (timerID == 0) {
   1.248 +        SDLTest_LogError("Creation of SDL timer failed: %s", SDL_GetError());
   1.249 +        return -1;
   1.250 +    }
   1.251  
   1.252 -	return timerID;
   1.253 +    return timerID;
   1.254  }
   1.255  
   1.256  /**
   1.257  * \brief Timeout handler. Aborts test run and exits harness process.
   1.258  */
   1.259  void
   1.260 -	SDLTest_BailOut()
   1.261 +    SDLTest_BailOut()
   1.262  {
   1.263 -	SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run.");
   1.264 -	exit(TEST_ABORTED); /* bail out from the test */
   1.265 +    SDLTest_LogError("TestCaseTimeout timer expired. Aborting test run.");
   1.266 +    exit(TEST_ABORTED); /* bail out from the test */
   1.267  }
   1.268  
   1.269  /**
   1.270 @@ -223,127 +223,127 @@
   1.271  int
   1.272  SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, SDLTest_TestCaseReference *testCase, Uint64 execKey)
   1.273  {
   1.274 -	SDL_TimerID timer = 0;
   1.275 -	int testCaseResult = 0;
   1.276 -	int testResult = 0;
   1.277 -	int fuzzerCount;
   1.278 +    SDL_TimerID timer = 0;
   1.279 +    int testCaseResult = 0;
   1.280 +    int testResult = 0;
   1.281 +    int fuzzerCount;
   1.282  
   1.283 -	if (testSuite==NULL || testCase==NULL || testSuite->name==NULL || testCase->name==NULL)
   1.284 -	{
   1.285 -		SDLTest_LogError("Setup failure: testSuite or testCase references NULL");
   1.286 -		return TEST_RESULT_SETUP_FAILURE;
   1.287 -	}
   1.288 +    if (testSuite==NULL || testCase==NULL || testSuite->name==NULL || testCase->name==NULL)
   1.289 +    {
   1.290 +        SDLTest_LogError("Setup failure: testSuite or testCase references NULL");
   1.291 +        return TEST_RESULT_SETUP_FAILURE;
   1.292 +    }
   1.293  
   1.294 -	if (!testCase->enabled)
   1.295 -	{
   1.296 -		SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)");
   1.297 -		return TEST_RESULT_SKIPPED;
   1.298 -	}
   1.299 +    if (!testCase->enabled)
   1.300 +    {
   1.301 +        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Disabled)");
   1.302 +        return TEST_RESULT_SKIPPED;
   1.303 +    }
   1.304  
   1.305  
   1.306 -	/* Initialize fuzzer */
   1.307 -	SDLTest_FuzzerInit(execKey);
   1.308 +    /* Initialize fuzzer */
   1.309 +    SDLTest_FuzzerInit(execKey);
   1.310  
   1.311 -	/* Reset assert tracker */
   1.312 -	SDLTest_ResetAssertSummary();
   1.313 +    /* Reset assert tracker */
   1.314 +    SDLTest_ResetAssertSummary();
   1.315  
   1.316 -	/* Set timeout timer */
   1.317 -	timer = SDLTest_SetTestTimeout(SDLTest_TestCaseTimeout, SDLTest_BailOut);
   1.318 +    /* Set timeout timer */
   1.319 +    timer = SDLTest_SetTestTimeout(SDLTest_TestCaseTimeout, SDLTest_BailOut);
   1.320  
   1.321 -	/* Maybe run suite initalizer function */
   1.322 -	if (testSuite->testSetUp) {
   1.323 -		testSuite->testSetUp(0x0);
   1.324 -		if (SDLTest_AssertSummaryToTestResult() == TEST_RESULT_FAILED) {
   1.325 -			SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite Setup", testSuite->name, "Failed");
   1.326 -			return TEST_RESULT_SETUP_FAILURE;
   1.327 -		}
   1.328 -	}
   1.329 +    /* Maybe run suite initalizer function */
   1.330 +    if (testSuite->testSetUp) {
   1.331 +        testSuite->testSetUp(0x0);
   1.332 +        if (SDLTest_AssertSummaryToTestResult() == TEST_RESULT_FAILED) {
   1.333 +            SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite Setup", testSuite->name, "Failed");
   1.334 +            return TEST_RESULT_SETUP_FAILURE;
   1.335 +        }
   1.336 +    }
   1.337 +
   1.338 +    /* Run test case function */
   1.339 +    testCaseResult = testCase->testCase(0x0);
   1.340  
   1.341 -	/* Run test case function */
   1.342 -	testCaseResult = testCase->testCase(0x0);
   1.343 -	
   1.344 -	/* Convert test execution result into harness result */
   1.345 -	if (testCaseResult == TEST_SKIPPED) {
   1.346 -		/* Test was programatically skipped */
   1.347 -		testResult = TEST_RESULT_SKIPPED;
   1.348 -	} else if (testCaseResult == TEST_STARTED) {
   1.349 -		/* Test did not return a TEST_COMPLETED value; assume it failed */
   1.350 -		testResult = TEST_RESULT_FAILED;
   1.351 -	} else if (testCaseResult == TEST_ABORTED) {
   1.352 -		/* Test was aborted early; assume it failed */
   1.353 -		testResult = TEST_RESULT_FAILED;
   1.354 -	} else {
   1.355 -		/* Perform failure analysis based on asserts */
   1.356 -		testResult = SDLTest_AssertSummaryToTestResult();
   1.357 -	}
   1.358 +    /* Convert test execution result into harness result */
   1.359 +    if (testCaseResult == TEST_SKIPPED) {
   1.360 +        /* Test was programatically skipped */
   1.361 +        testResult = TEST_RESULT_SKIPPED;
   1.362 +    } else if (testCaseResult == TEST_STARTED) {
   1.363 +        /* Test did not return a TEST_COMPLETED value; assume it failed */
   1.364 +        testResult = TEST_RESULT_FAILED;
   1.365 +    } else if (testCaseResult == TEST_ABORTED) {
   1.366 +        /* Test was aborted early; assume it failed */
   1.367 +        testResult = TEST_RESULT_FAILED;
   1.368 +    } else {
   1.369 +        /* Perform failure analysis based on asserts */
   1.370 +        testResult = SDLTest_AssertSummaryToTestResult();
   1.371 +    }
   1.372  
   1.373 -	/* Maybe run suite cleanup function (ignore failed asserts) */
   1.374 -	if (testSuite->testTearDown) {
   1.375 -		testSuite->testTearDown(0x0);
   1.376 -	}
   1.377 +    /* Maybe run suite cleanup function (ignore failed asserts) */
   1.378 +    if (testSuite->testTearDown) {
   1.379 +        testSuite->testTearDown(0x0);
   1.380 +    }
   1.381  
   1.382 -	/* Cancel timeout timer */
   1.383 -	if (timer) {
   1.384 -		SDL_RemoveTimer(timer);
   1.385 -	}
   1.386 +    /* Cancel timeout timer */
   1.387 +    if (timer) {
   1.388 +        SDL_RemoveTimer(timer);
   1.389 +    }
   1.390  
   1.391 -	/* Report on asserts and fuzzer usage */
   1.392 -	fuzzerCount = SDLTest_GetFuzzerInvocationCount();
   1.393 -	if (fuzzerCount > 0) {
   1.394 -		SDLTest_Log("Fuzzer invocations: %d", fuzzerCount);
   1.395 -	}
   1.396 +    /* Report on asserts and fuzzer usage */
   1.397 +    fuzzerCount = SDLTest_GetFuzzerInvocationCount();
   1.398 +    if (fuzzerCount > 0) {
   1.399 +        SDLTest_Log("Fuzzer invocations: %d", fuzzerCount);
   1.400 +    }
   1.401  
   1.402 -	/* Final log based on test execution result */
   1.403 -	if (testCaseResult == TEST_SKIPPED) {
   1.404 -		/* Test was programatically skipped */
   1.405 -		SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Programmatically)");
   1.406 -	} else if (testCaseResult == TEST_STARTED) {
   1.407 -		/* Test did not return a TEST_COMPLETED value; assume it failed */
   1.408 -		SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (test started, but did not return TEST_COMPLETED)");
   1.409 -	} else if (testCaseResult == TEST_ABORTED) {
   1.410 -		/* Test was aborted early; assume it failed */
   1.411 -		SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (Aborted)");
   1.412 -	} else {
   1.413 -		SDLTest_LogAssertSummary();
   1.414 -	}
   1.415 +    /* Final log based on test execution result */
   1.416 +    if (testCaseResult == TEST_SKIPPED) {
   1.417 +        /* Test was programatically skipped */
   1.418 +        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Skipped (Programmatically)");
   1.419 +    } else if (testCaseResult == TEST_STARTED) {
   1.420 +        /* Test did not return a TEST_COMPLETED value; assume it failed */
   1.421 +        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (test started, but did not return TEST_COMPLETED)");
   1.422 +    } else if (testCaseResult == TEST_ABORTED) {
   1.423 +        /* Test was aborted early; assume it failed */
   1.424 +        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", testCase->name, "Failed (Aborted)");
   1.425 +    } else {
   1.426 +        SDLTest_LogAssertSummary();
   1.427 +    }
   1.428  
   1.429 -	return testResult;
   1.430 +    return testResult;
   1.431  }
   1.432  
   1.433  /* Prints summary of all suites/tests contained in the given reference */
   1.434  void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
   1.435  {
   1.436 -	int suiteCounter;
   1.437 -	int testCounter;
   1.438 -	SDLTest_TestSuiteReference *testSuite;
   1.439 -	SDLTest_TestCaseReference *testCase;
   1.440 +    int suiteCounter;
   1.441 +    int testCounter;
   1.442 +    SDLTest_TestSuiteReference *testSuite;
   1.443 +    SDLTest_TestCaseReference *testCase;
   1.444  
   1.445 -	/* Loop over all suites */
   1.446 -	suiteCounter = 0;
   1.447 -	while(&testSuites[suiteCounter]) {
   1.448 -		testSuite=&testSuites[suiteCounter];
   1.449 -		suiteCounter++;
   1.450 -		SDLTest_Log("Test Suite %i - %s\n", suiteCounter, 
   1.451 -			(testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
   1.452 +    /* Loop over all suites */
   1.453 +    suiteCounter = 0;
   1.454 +    while(&testSuites[suiteCounter]) {
   1.455 +        testSuite=&testSuites[suiteCounter];
   1.456 +        suiteCounter++;
   1.457 +        SDLTest_Log("Test Suite %i - %s\n", suiteCounter,
   1.458 +            (testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
   1.459  
   1.460 -		/* Loop over all test cases */
   1.461 -		testCounter = 0;
   1.462 -		while(testSuite->testCases[testCounter])
   1.463 -		{
   1.464 -			testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
   1.465 -			testCounter++;
   1.466 -			SDLTest_Log("  Test Case %i - %s: %s", testCounter, 
   1.467 -				(testCase->name) ? testCase->name : SDLTest_InvalidNameFormat, 
   1.468 -				(testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
   1.469 -		}
   1.470 -	}
   1.471 +        /* Loop over all test cases */
   1.472 +        testCounter = 0;
   1.473 +        while(testSuite->testCases[testCounter])
   1.474 +        {
   1.475 +            testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
   1.476 +            testCounter++;
   1.477 +            SDLTest_Log("  Test Case %i - %s: %s", testCounter,
   1.478 +                (testCase->name) ? testCase->name : SDLTest_InvalidNameFormat,
   1.479 +                (testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
   1.480 +        }
   1.481 +    }
   1.482  }
   1.483  
   1.484  /* Gets a timer value in seconds */
   1.485  float GetClock()
   1.486  {
   1.487 -	float currentClock = (float)clock();
   1.488 -	return currentClock / (float)CLOCKS_PER_SEC;
   1.489 +    float currentClock = (float)clock();
   1.490 +    return currentClock / (float)CLOCKS_PER_SEC;
   1.491  }
   1.492  
   1.493  /**
   1.494 @@ -362,274 +362,274 @@
   1.495  */
   1.496  int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations)
   1.497  {
   1.498 -	int suiteCounter;
   1.499 -	int testCounter;
   1.500 -	int iterationCounter;
   1.501 -	SDLTest_TestSuiteReference *testSuite;
   1.502 -	SDLTest_TestCaseReference *testCase;
   1.503 -	const char *runSeed = NULL;
   1.504 -	char *currentSuiteName;
   1.505 -	char *currentTestName;
   1.506 -	Uint64 execKey;
   1.507 -	float runStartSeconds;
   1.508 -	float suiteStartSeconds;
   1.509 -	float testStartSeconds;
   1.510 -	float runEndSeconds;
   1.511 -	float suiteEndSeconds;
   1.512 -	float testEndSeconds;
   1.513 -	float runtime;
   1.514 -	int suiteFilter = 0;
   1.515 -	char *suiteFilterName = NULL;
   1.516 -	int testFilter = 0;
   1.517 -	char *testFilterName = NULL;
   1.518 -	int testResult = 0;
   1.519 -	int runResult = 0;
   1.520 -	Uint32 totalTestFailedCount = 0;
   1.521 -	Uint32 totalTestPassedCount = 0;
   1.522 -	Uint32 totalTestSkippedCount = 0;
   1.523 -	Uint32 testFailedCount = 0;
   1.524 -	Uint32 testPassedCount = 0;
   1.525 -	Uint32 testSkippedCount = 0;
   1.526 -	Uint32 countSum = 0;
   1.527 -	char *logFormat = (char *)SDLTest_LogSummaryFormat;
   1.528 +    int suiteCounter;
   1.529 +    int testCounter;
   1.530 +    int iterationCounter;
   1.531 +    SDLTest_TestSuiteReference *testSuite;
   1.532 +    SDLTest_TestCaseReference *testCase;
   1.533 +    const char *runSeed = NULL;
   1.534 +    char *currentSuiteName;
   1.535 +    char *currentTestName;
   1.536 +    Uint64 execKey;
   1.537 +    float runStartSeconds;
   1.538 +    float suiteStartSeconds;
   1.539 +    float testStartSeconds;
   1.540 +    float runEndSeconds;
   1.541 +    float suiteEndSeconds;
   1.542 +    float testEndSeconds;
   1.543 +    float runtime;
   1.544 +    int suiteFilter = 0;
   1.545 +    char *suiteFilterName = NULL;
   1.546 +    int testFilter = 0;
   1.547 +    char *testFilterName = NULL;
   1.548 +    int testResult = 0;
   1.549 +    int runResult = 0;
   1.550 +    Uint32 totalTestFailedCount = 0;
   1.551 +    Uint32 totalTestPassedCount = 0;
   1.552 +    Uint32 totalTestSkippedCount = 0;
   1.553 +    Uint32 testFailedCount = 0;
   1.554 +    Uint32 testPassedCount = 0;
   1.555 +    Uint32 testSkippedCount = 0;
   1.556 +    Uint32 countSum = 0;
   1.557 +    char *logFormat = (char *)SDLTest_LogSummaryFormat;
   1.558  
   1.559 -	/* Sanitize test iterations */
   1.560 -	if (testIterations < 1) {
   1.561 -		testIterations = 1;
   1.562 -	}
   1.563 +    /* Sanitize test iterations */
   1.564 +    if (testIterations < 1) {
   1.565 +        testIterations = 1;
   1.566 +    }
   1.567  
   1.568 -	/* Generate run see if we don't have one already */
   1.569 -	if (userRunSeed == NULL || SDL_strlen(userRunSeed) == 0) {
   1.570 -		runSeed = SDLTest_GenerateRunSeed(16);
   1.571 -		if (runSeed == NULL) {
   1.572 -			SDLTest_LogError("Generating a random seed failed");
   1.573 -			return 2;
   1.574 -		}
   1.575 -	} else {
   1.576 -		runSeed = userRunSeed;
   1.577 -	}
   1.578 +    /* Generate run see if we don't have one already */
   1.579 +    if (userRunSeed == NULL || SDL_strlen(userRunSeed) == 0) {
   1.580 +        runSeed = SDLTest_GenerateRunSeed(16);
   1.581 +        if (runSeed == NULL) {
   1.582 +            SDLTest_LogError("Generating a random seed failed");
   1.583 +            return 2;
   1.584 +        }
   1.585 +    } else {
   1.586 +        runSeed = userRunSeed;
   1.587 +    }
   1.588  
   1.589  
   1.590 -	/* Reset per-run counters */
   1.591 -	totalTestFailedCount = 0;
   1.592 -	totalTestPassedCount = 0;
   1.593 -	totalTestSkippedCount = 0;
   1.594 +    /* Reset per-run counters */
   1.595 +    totalTestFailedCount = 0;
   1.596 +    totalTestPassedCount = 0;
   1.597 +    totalTestSkippedCount = 0;
   1.598  
   1.599 -	/* Take time - run start */
   1.600 -	runStartSeconds = GetClock();
   1.601 +    /* Take time - run start */
   1.602 +    runStartSeconds = GetClock();
   1.603  
   1.604 -	/* Log run with fuzzer parameters */
   1.605 -	SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed);
   1.606 +    /* Log run with fuzzer parameters */
   1.607 +    SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed);
   1.608  
   1.609 -	/* Initialize filtering */
   1.610 -	if (filter != NULL && SDL_strlen(filter) > 0) {
   1.611 -		/* Loop over all suites to check if we have a filter match */
   1.612 -		suiteCounter = 0;
   1.613 -		while (testSuites[suiteCounter] && suiteFilter == 0) {
   1.614 -			testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
   1.615 -			suiteCounter++;
   1.616 -			if (testSuite->name != NULL && SDL_strcmp(filter, testSuite->name) == 0) {
   1.617 -				/* Matched a suite name */
   1.618 -				suiteFilter = 1;
   1.619 -				suiteFilterName = testSuite->name;
   1.620 -				SDLTest_Log("Filtering: running only suite '%s'", suiteFilterName);
   1.621 -				break;
   1.622 -			}
   1.623 +    /* Initialize filtering */
   1.624 +    if (filter != NULL && SDL_strlen(filter) > 0) {
   1.625 +        /* Loop over all suites to check if we have a filter match */
   1.626 +        suiteCounter = 0;
   1.627 +        while (testSuites[suiteCounter] && suiteFilter == 0) {
   1.628 +            testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
   1.629 +            suiteCounter++;
   1.630 +            if (testSuite->name != NULL && SDL_strcmp(filter, testSuite->name) == 0) {
   1.631 +                /* Matched a suite name */
   1.632 +                suiteFilter = 1;
   1.633 +                suiteFilterName = testSuite->name;
   1.634 +                SDLTest_Log("Filtering: running only suite '%s'", suiteFilterName);
   1.635 +                break;
   1.636 +            }
   1.637  
   1.638 -			/* Within each suite, loop over all test cases to check if we have a filter match */
   1.639 -			testCounter = 0;
   1.640 -			while (testSuite->testCases[testCounter] && testFilter == 0)
   1.641 -			{
   1.642 -				testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
   1.643 -				testCounter++;
   1.644 -				if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) {
   1.645 -					/* Matched a test name */
   1.646 -					suiteFilter = 1;
   1.647 -					suiteFilterName = testSuite->name;
   1.648 -					testFilter = 1;
   1.649 -					testFilterName = testCase->name;
   1.650 -					SDLTest_Log("Filtering: running only test '%s' in suite '%s'", testFilterName, suiteFilterName);					
   1.651 -					break;
   1.652 -				}
   1.653 -			}						
   1.654 -		}
   1.655 -		
   1.656 -		if (suiteFilter == 0 && testFilter == 0) {
   1.657 -			SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter);
   1.658 -			SDLTest_Log("Exit code: 2");	
   1.659 -			return 2;
   1.660 -		}		
   1.661 -	}
   1.662 +            /* Within each suite, loop over all test cases to check if we have a filter match */
   1.663 +            testCounter = 0;
   1.664 +            while (testSuite->testCases[testCounter] && testFilter == 0)
   1.665 +            {
   1.666 +                testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
   1.667 +                testCounter++;
   1.668 +                if (testCase->name != NULL && SDL_strcmp(filter, testCase->name) == 0) {
   1.669 +                    /* Matched a test name */
   1.670 +                    suiteFilter = 1;
   1.671 +                    suiteFilterName = testSuite->name;
   1.672 +                    testFilter = 1;
   1.673 +                    testFilterName = testCase->name;
   1.674 +                    SDLTest_Log("Filtering: running only test '%s' in suite '%s'", testFilterName, suiteFilterName);
   1.675 +                    break;
   1.676 +                }
   1.677 +            }
   1.678 +        }
   1.679 +
   1.680 +        if (suiteFilter == 0 && testFilter == 0) {
   1.681 +            SDLTest_LogError("Filter '%s' did not match any test suite/case.", filter);
   1.682 +            SDLTest_Log("Exit code: 2");
   1.683 +            return 2;
   1.684 +        }
   1.685 +    }
   1.686  
   1.687 -	/* Loop over all suites */
   1.688 -	suiteCounter = 0;
   1.689 -	while(testSuites[suiteCounter]) {
   1.690 -		testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
   1.691 -		currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
   1.692 -		suiteCounter++;
   1.693 +    /* Loop over all suites */
   1.694 +    suiteCounter = 0;
   1.695 +    while(testSuites[suiteCounter]) {
   1.696 +        testSuite=(SDLTest_TestSuiteReference *)testSuites[suiteCounter];
   1.697 +        currentSuiteName = (char *)((testSuite->name) ? testSuite->name : SDLTest_InvalidNameFormat);
   1.698 +        suiteCounter++;
   1.699  
   1.700 -		/* Filter suite if flag set and we have a name */
   1.701 -		if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL &&
   1.702 -			SDL_strcmp(suiteFilterName, testSuite->name) != 0) {
   1.703 -				/* Skip suite */
   1.704 -				SDLTest_Log("===== Test Suite %i: '%s' skipped\n", 
   1.705 -					suiteCounter, 
   1.706 -					currentSuiteName);
   1.707 -		} else {
   1.708 +        /* Filter suite if flag set and we have a name */
   1.709 +        if (suiteFilter == 1 && suiteFilterName != NULL && testSuite->name != NULL &&
   1.710 +            SDL_strcmp(suiteFilterName, testSuite->name) != 0) {
   1.711 +                /* Skip suite */
   1.712 +                SDLTest_Log("===== Test Suite %i: '%s' skipped\n",
   1.713 +                    suiteCounter,
   1.714 +                    currentSuiteName);
   1.715 +        } else {
   1.716  
   1.717 -			/* Reset per-suite counters */
   1.718 -			testFailedCount = 0;
   1.719 -			testPassedCount = 0;
   1.720 -			testSkippedCount = 0;
   1.721 +            /* Reset per-suite counters */
   1.722 +            testFailedCount = 0;
   1.723 +            testPassedCount = 0;
   1.724 +            testSkippedCount = 0;
   1.725  
   1.726 -			/* Take time - suite start */
   1.727 -			suiteStartSeconds = GetClock();
   1.728 +            /* Take time - suite start */
   1.729 +            suiteStartSeconds = GetClock();
   1.730  
   1.731 -			/* Log suite started */
   1.732 -			SDLTest_Log("===== Test Suite %i: '%s' started\n", 
   1.733 -				suiteCounter, 
   1.734 -				currentSuiteName);
   1.735 +            /* Log suite started */
   1.736 +            SDLTest_Log("===== Test Suite %i: '%s' started\n",
   1.737 +                suiteCounter,
   1.738 +                currentSuiteName);
   1.739  
   1.740 -			/* Loop over all test cases */
   1.741 -			testCounter = 0;
   1.742 -			while(testSuite->testCases[testCounter])
   1.743 -			{
   1.744 -				testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
   1.745 -				currentTestName = (char *)((testCase->name) ? testCase->name : SDLTest_InvalidNameFormat);
   1.746 -				testCounter++;
   1.747 +            /* Loop over all test cases */
   1.748 +            testCounter = 0;
   1.749 +            while(testSuite->testCases[testCounter])
   1.750 +            {
   1.751 +                testCase=(SDLTest_TestCaseReference *)testSuite->testCases[testCounter];
   1.752 +                currentTestName = (char *)((testCase->name) ? testCase->name : SDLTest_InvalidNameFormat);
   1.753 +                testCounter++;
   1.754  
   1.755 -				/* Filter tests if flag set and we have a name */
   1.756 -				if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL &&
   1.757 -					SDL_strcmp(testFilterName, testCase->name) != 0) {
   1.758 -						/* Skip test */
   1.759 -						SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n", 
   1.760 -							suiteCounter,
   1.761 -							testCounter,
   1.762 -							currentTestName);
   1.763 -				} else {
   1.764 -					/* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
   1.765 -					if (testFilter == 1 && !testCase->enabled) {
   1.766 -						SDLTest_Log("Force run of disabled test since test filter was set");
   1.767 -						testCase->enabled = 1;
   1.768 -					}
   1.769 +                /* Filter tests if flag set and we have a name */
   1.770 +                if (testFilter == 1 && testFilterName != NULL && testCase->name != NULL &&
   1.771 +                    SDL_strcmp(testFilterName, testCase->name) != 0) {
   1.772 +                        /* Skip test */
   1.773 +                        SDLTest_Log("===== Test Case %i.%i: '%s' skipped\n",
   1.774 +                            suiteCounter,
   1.775 +                            testCounter,
   1.776 +                            currentTestName);
   1.777 +                } else {
   1.778 +                    /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
   1.779 +                    if (testFilter == 1 && !testCase->enabled) {
   1.780 +                        SDLTest_Log("Force run of disabled test since test filter was set");
   1.781 +                        testCase->enabled = 1;
   1.782 +                    }
   1.783  
   1.784 -					/* Take time - test start */
   1.785 -					testStartSeconds = GetClock();
   1.786 +                    /* Take time - test start */
   1.787 +                    testStartSeconds = GetClock();
   1.788  
   1.789 -					/* Log test started */
   1.790 -					SDLTest_Log("----- Test Case %i.%i: '%s' started",
   1.791 -						suiteCounter,
   1.792 -						testCounter, 
   1.793 -						currentTestName);
   1.794 -					if (testCase->description != NULL && SDL_strlen(testCase->description)>0) {
   1.795 -						SDLTest_Log("Test Description: '%s'", 
   1.796 -							(testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
   1.797 -					}
   1.798 +                    /* Log test started */
   1.799 +                    SDLTest_Log("----- Test Case %i.%i: '%s' started",
   1.800 +                        suiteCounter,
   1.801 +                        testCounter,
   1.802 +                        currentTestName);
   1.803 +                    if (testCase->description != NULL && SDL_strlen(testCase->description)>0) {
   1.804 +                        SDLTest_Log("Test Description: '%s'",
   1.805 +                            (testCase->description) ? testCase->description : SDLTest_InvalidNameFormat);
   1.806 +                    }
   1.807  
   1.808 -					/* Loop over all iterations */
   1.809 -					iterationCounter = 0;
   1.810 -					while(iterationCounter < testIterations)
   1.811 -					{
   1.812 -						iterationCounter++;
   1.813 +                    /* Loop over all iterations */
   1.814 +                    iterationCounter = 0;
   1.815 +                    while(iterationCounter < testIterations)
   1.816 +                    {
   1.817 +                        iterationCounter++;
   1.818  
   1.819 -						if (userExecKey != 0) {
   1.820 -							execKey = userExecKey;
   1.821 -						} else {
   1.822 -							execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
   1.823 -						}
   1.824 +                        if (userExecKey != 0) {
   1.825 +                            execKey = userExecKey;
   1.826 +                        } else {
   1.827 +                            execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
   1.828 +                        }
   1.829  
   1.830 -						SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
   1.831 -						testResult = SDLTest_RunTest(testSuite, testCase, execKey);
   1.832 +                        SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
   1.833 +                        testResult = SDLTest_RunTest(testSuite, testCase, execKey);
   1.834  
   1.835 -						if (testResult == TEST_RESULT_PASSED) {
   1.836 -							testPassedCount++;
   1.837 -							totalTestPassedCount++;
   1.838 -						} else if (testResult == TEST_RESULT_SKIPPED) {
   1.839 -							testSkippedCount++;
   1.840 -							totalTestSkippedCount++;
   1.841 -						} else {
   1.842 -							testFailedCount++;
   1.843 -							totalTestFailedCount++;
   1.844 -						}
   1.845 -					}
   1.846 +                        if (testResult == TEST_RESULT_PASSED) {
   1.847 +                            testPassedCount++;
   1.848 +                            totalTestPassedCount++;
   1.849 +                        } else if (testResult == TEST_RESULT_SKIPPED) {
   1.850 +                            testSkippedCount++;
   1.851 +                            totalTestSkippedCount++;
   1.852 +                        } else {
   1.853 +                            testFailedCount++;
   1.854 +                            totalTestFailedCount++;
   1.855 +                        }
   1.856 +                    }
   1.857  
   1.858 -					/* Take time - test end */
   1.859 -					testEndSeconds = GetClock();
   1.860 -					runtime = testEndSeconds - testStartSeconds;
   1.861 -					if (runtime < 0.0f) runtime = 0.0f;
   1.862 +                    /* Take time - test end */
   1.863 +                    testEndSeconds = GetClock();
   1.864 +                    runtime = testEndSeconds - testStartSeconds;
   1.865 +                    if (runtime < 0.0f) runtime = 0.0f;
   1.866  
   1.867 -					if (testIterations > 1) {
   1.868 -						/* Log test runtime */
   1.869 -						SDLTest_Log("Runtime of %i iterations: %.1f sec", testIterations, runtime);
   1.870 -						SDLTest_Log("Average Test runtime: %.5f sec", runtime / (float)testIterations);
   1.871 -					} else {
   1.872 -						/* Log test runtime */
   1.873 -						SDLTest_Log("Total Test runtime: %.1f sec", runtime);
   1.874 -					}
   1.875 +                    if (testIterations > 1) {
   1.876 +                        /* Log test runtime */
   1.877 +                        SDLTest_Log("Runtime of %i iterations: %.1f sec", testIterations, runtime);
   1.878 +                        SDLTest_Log("Average Test runtime: %.5f sec", runtime / (float)testIterations);
   1.879 +                    } else {
   1.880 +                        /* Log test runtime */
   1.881 +                        SDLTest_Log("Total Test runtime: %.1f sec", runtime);
   1.882 +                    }
   1.883  
   1.884 -					/* Log final test result */
   1.885 -					switch (testResult) {
   1.886 -					case TEST_RESULT_PASSED:
   1.887 -						SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Passed");
   1.888 -						break;
   1.889 -					case TEST_RESULT_FAILED:
   1.890 -						SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Failed");
   1.891 -						break;
   1.892 -					case TEST_RESULT_NO_ASSERT:
   1.893 -						SDLTest_LogError((char *)SDLTest_FinalResultFormat,"Test", currentTestName, "No Asserts");
   1.894 -						break;
   1.895 -					}
   1.896 +                    /* Log final test result */
   1.897 +                    switch (testResult) {
   1.898 +                    case TEST_RESULT_PASSED:
   1.899 +                        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Passed");
   1.900 +                        break;
   1.901 +                    case TEST_RESULT_FAILED:
   1.902 +                        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Test", currentTestName, "Failed");
   1.903 +                        break;
   1.904 +                    case TEST_RESULT_NO_ASSERT:
   1.905 +                        SDLTest_LogError((char *)SDLTest_FinalResultFormat,"Test", currentTestName, "No Asserts");
   1.906 +                        break;
   1.907 +                    }
   1.908  
   1.909 -				}
   1.910 -			}
   1.911 +                }
   1.912 +            }
   1.913  
   1.914 -			/* Take time - suite end */
   1.915 -			suiteEndSeconds = GetClock();
   1.916 -			runtime = suiteEndSeconds - suiteStartSeconds;
   1.917 -			if (runtime < 0.0f) runtime = 0.0f;
   1.918 +            /* Take time - suite end */
   1.919 +            suiteEndSeconds = GetClock();
   1.920 +            runtime = suiteEndSeconds - suiteStartSeconds;
   1.921 +            if (runtime < 0.0f) runtime = 0.0f;
   1.922  
   1.923 -			/* Log suite runtime */
   1.924 -			SDLTest_Log("Total Suite runtime: %.1f sec", runtime);
   1.925 +            /* Log suite runtime */
   1.926 +            SDLTest_Log("Total Suite runtime: %.1f sec", runtime);
   1.927  
   1.928 -			/* Log summary and final Suite result */
   1.929 -			countSum = testPassedCount + testFailedCount + testSkippedCount;
   1.930 -			if (testFailedCount == 0)
   1.931 -			{
   1.932 -				SDLTest_Log(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
   1.933 -				SDLTest_Log((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Passed");
   1.934 -			} 
   1.935 -			else 
   1.936 -			{
   1.937 -				SDLTest_LogError(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
   1.938 -				SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Failed");
   1.939 -			}
   1.940 +            /* Log summary and final Suite result */
   1.941 +            countSum = testPassedCount + testFailedCount + testSkippedCount;
   1.942 +            if (testFailedCount == 0)
   1.943 +            {
   1.944 +                SDLTest_Log(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
   1.945 +                SDLTest_Log((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Passed");
   1.946 +            }
   1.947 +            else
   1.948 +            {
   1.949 +                SDLTest_LogError(logFormat, "Suite", countSum, testPassedCount, testFailedCount, testSkippedCount);
   1.950 +                SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Suite", currentSuiteName, "Failed");
   1.951 +            }
   1.952  
   1.953 -		}
   1.954 -	}
   1.955 +        }
   1.956 +    }
   1.957  
   1.958 -	/* Take time - run end */
   1.959 -	runEndSeconds = GetClock();
   1.960 -	runtime = runEndSeconds - runStartSeconds;
   1.961 -	if (runtime < 0.0f) runtime = 0.0f;
   1.962 +    /* Take time - run end */
   1.963 +    runEndSeconds = GetClock();
   1.964 +    runtime = runEndSeconds - runStartSeconds;
   1.965 +    if (runtime < 0.0f) runtime = 0.0f;
   1.966  
   1.967 -	/* Log total runtime */
   1.968 -	SDLTest_Log("Total Run runtime: %.1f sec", runtime);
   1.969 +    /* Log total runtime */
   1.970 +    SDLTest_Log("Total Run runtime: %.1f sec", runtime);
   1.971  
   1.972 -	/* Log summary and final run result */
   1.973 -	countSum = totalTestPassedCount + totalTestFailedCount + totalTestSkippedCount;
   1.974 -	if (totalTestFailedCount == 0)
   1.975 -	{
   1.976 -		runResult = 0;
   1.977 -		SDLTest_Log(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
   1.978 -		SDLTest_Log((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Passed");
   1.979 -	} 
   1.980 -	else 
   1.981 -	{
   1.982 -		runResult = 1;
   1.983 -		SDLTest_LogError(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
   1.984 -		SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Failed");
   1.985 -	}
   1.986 +    /* Log summary and final run result */
   1.987 +    countSum = totalTestPassedCount + totalTestFailedCount + totalTestSkippedCount;
   1.988 +    if (totalTestFailedCount == 0)
   1.989 +    {
   1.990 +        runResult = 0;
   1.991 +        SDLTest_Log(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
   1.992 +        SDLTest_Log((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Passed");
   1.993 +    }
   1.994 +    else
   1.995 +    {
   1.996 +        runResult = 1;
   1.997 +        SDLTest_LogError(logFormat, "Run", countSum, totalTestPassedCount, totalTestFailedCount, totalTestSkippedCount);
   1.998 +        SDLTest_LogError((char *)SDLTest_FinalResultFormat, "Run /w seed", runSeed, "Failed");
   1.999 +    }
  1.1000  
  1.1001 -	SDLTest_Log("Exit code: %d", runResult);	
  1.1002 -	return runResult;
  1.1003 +    SDLTest_Log("Exit code: %d", runResult);
  1.1004 +    return runResult;
  1.1005  }