Added comments and did some cleaning.
authorMarkus Kauppila
Thu, 09 Jun 2011 18:07:50 +0300
changeset 56942fc30d9b1002
parent 5693 cd0110de8ad5
child 5695 6d81a581e6f5
Added comments and did some cleaning.
test/test-automation/runner.c
test/test-automation/testdummy/testdummy.c
     1.1 --- a/test/test-automation/runner.c	Thu Jun 09 17:13:33 2011 +0300
     1.2 +++ b/test/test-automation/runner.c	Thu Jun 09 18:07:50 2011 +0300
     1.3 @@ -30,16 +30,17 @@
     1.4  
     1.5  #include "SDL_test.h"
     1.6  
     1.7 +
     1.8  //!< Function pointer to a test case function
     1.9 -typedef void (*TestCase)(void *arg);
    1.10 +typedef void (*TestCaseFp)(void *arg);
    1.11  //!< Function pointer to a test case init function
    1.12 -typedef void (*TestCaseInit)(void);
    1.13 +typedef void (*TestCaseInitFp)(void);
    1.14  //!< Function pointer to a test case quit function
    1.15 -typedef int  (*TestCaseQuit)(void);
    1.16 +typedef int  (*TestCaseQuitFp)(void);
    1.17 +
    1.18  
    1.19  //!< Flag for executing tests in-process
    1.20  static int execute_inproc = 0;
    1.21 -
    1.22  //!< Flag for executing only test with selected name
    1.23  static int only_selected_test  = 0;
    1.24  //!< Flag for executing only the selected test suite
    1.25 @@ -58,31 +59,46 @@
    1.26  //!< substring of test case name
    1.27  char testcase_name_substring[NAME_BUFFER_SIZE];
    1.28  
    1.29 -
    1.30  //! Default directory of the test suites
    1.31  #define DEFAULT_TEST_DIRECTORY "tests/"
    1.32  
    1.33 +
    1.34  /*!
    1.35 - * Holds information about test suite. Implemented as
    1.36 - * linked list. \todo write better doc
    1.37 + * Holds information about test suite such as it's name
    1.38 + * and pointer to dynamic library. Implemented as linked list.
    1.39   */
    1.40  typedef struct TestSuiteReference {
    1.41  	char *name; //!< test suite name
    1.42 -	void *library; //!< pointer to shared/dynamic library implemeting the suite
    1.43 +	void *library; //!< pointer to shared/dynamic library implementing the suite
    1.44  
    1.45  	struct TestSuiteReference *next; //!< Pointer to next item in the list
    1.46  } TestSuiteReference;
    1.47  
    1.48 +
    1.49 +/*!
    1.50 + * Holds information about the tests that will be executed.
    1.51 + *
    1.52 + * Implemented as linked list.
    1.53 + */
    1.54  typedef struct TestCaseItem {
    1.55  	char *testName;
    1.56  	char *suiteName;
    1.57  
    1.58 -	TestCaseInit testCaseInit;
    1.59 -	TestCase testCase;
    1.60 -	TestCaseQuit testCaseQuit;
    1.61 +	TestCaseInitFp testCaseInit;
    1.62 +	TestCaseFp testCase;
    1.63 +	TestCaseQuitFp testCaseQuit;
    1.64  
    1.65  	struct TestCaseItem *next;
    1.66 -} TestCaseItem; //!< \todo rename
    1.67 +} TestCase;
    1.68 +
    1.69 +
    1.70 +
    1.71 +/*! Some function prototypes. Add the rest of functions and move to runner.h */
    1.72 +TestCaseFp LoadTestCaseFunction(void *suite, char *testName);
    1.73 +TestCaseInitFp LoadTestCaseInitFunction(void *suite);
    1.74 +TestCaseQuitFp LoadTestCaseQuitFunction(void *suite);
    1.75 +TestCaseReference **QueryTestCaseReferences(void *library);
    1.76 +
    1.77  
    1.78  /*!
    1.79   * Scans the tests/ directory and returns the names
    1.80 @@ -99,7 +115,8 @@
    1.81   * \return Pointer to TestSuiteReference which holds all the info about suites
    1.82   */
    1.83  TestSuiteReference *
    1.84 -ScanForTestSuites(char *directoryName, char *extension) {
    1.85 +ScanForTestSuites(char *directoryName, char *extension)
    1.86 +{
    1.87  	typedef struct dirent Entry;
    1.88  	DIR *directory = opendir(directoryName);
    1.89  
    1.90 @@ -107,7 +124,7 @@
    1.91  
    1.92  	Entry *entry = NULL;
    1.93  	if(!directory) {
    1.94 -		perror("Couldn't open directory: tests/");
    1.95 +		perror("Couldn't open test suite directory!");
    1.96  	}
    1.97  
    1.98  	while(entry = readdir(directory)) {
    1.99 @@ -143,7 +160,7 @@
   1.100  				reference->next = suites;
   1.101  				suites = reference;
   1.102  
   1.103 -				printf("Reference added to: %s\n", buffer);
   1.104 +				//printf("Reference added to: %s\n", buffer);
   1.105  			}
   1.106  		}
   1.107  	}
   1.108 @@ -155,6 +172,116 @@
   1.109  
   1.110  
   1.111  /*!
   1.112 + * Goes through the previously loaded test suites and
   1.113 + * loads test cases from them. Test cases are filtered
   1.114 + * during the process. Function will only return the
   1.115 + * test cases which aren't filtered out.
   1.116 + *
   1.117 + * \param suite previously loaded test suites
   1.118 + *
   1.119 + * \return Test cases that survived filtering process.
   1.120 + */
   1.121 +TestCase *
   1.122 +LoadTestCases(TestSuiteReference *suites)
   1.123 +{
   1.124 +	TestCase *testCases = NULL;
   1.125 +
   1.126 +	TestSuiteReference *suiteReference = NULL;
   1.127 +	for(suiteReference = suites; suiteReference; suiteReference = suiteReference->next) {
   1.128 +		TestCaseReference **tests = QueryTestCaseReferences(suiteReference->library);
   1.129 +
   1.130 +		TestCaseReference *testReference = NULL;
   1.131 +		int counter = 0;
   1.132 +		for(testReference = tests[counter]; testReference; testReference = tests[++counter]) {
   1.133 +
   1.134 +			void *suite = suiteReference->library;
   1.135 +
   1.136 +			// Load test case functions
   1.137 +			TestCaseInitFp testCaseInit = LoadTestCaseInitFunction(suiteReference->library);
   1.138 +			TestCaseQuitFp testCaseQuit = LoadTestCaseQuitFunction(suiteReference->library);
   1.139 +			TestCaseFp testCase = (TestCaseFp) LoadTestCaseFunction(suiteReference->library, testReference->name);
   1.140 +
   1.141 +			// Do the filtering
   1.142 +			if(FilterTestCase(testReference)) {
   1.143 +				TestCase *item = SDL_malloc(sizeof(TestCase));
   1.144 +				memset(item, 0, sizeof(TestCase));
   1.145 +
   1.146 +				item->testCaseInit = testCaseInit;
   1.147 +				item->testCase = testCase;
   1.148 +				item->testCaseQuit = testCaseQuit;
   1.149 +
   1.150 +				int length = strlen(suiteReference->name) + 1;
   1.151 +				item->suiteName = SDL_malloc(length);
   1.152 +				strcpy(item->suiteName, suiteReference->name);
   1.153 +
   1.154 +				length = strlen(testReference->name) + 1;
   1.155 +				item->testName = SDL_malloc(length);
   1.156 +				strcpy(item->testName, testReference->name);
   1.157 +
   1.158 +				// prepend the list
   1.159 +				item->next = testCases;
   1.160 +				testCases = item;
   1.161 +
   1.162 +				//printf("Added test: %s\n", testReference->name);
   1.163 +			}
   1.164 +		}
   1.165 +	}
   1.166 +
   1.167 +	return testCases;
   1.168 +}
   1.169 +
   1.170 +
   1.171 +/*!
   1.172 + * Unloads the given TestCases. Frees all the resources
   1.173 + * allocated for test cases.
   1.174 + *
   1.175 + * \param testCases Test cases to be deallocated
   1.176 + */
   1.177 +void
   1.178 +UnloadTestCases(TestCase *testCases)
   1.179 +{
   1.180 +	TestCase *ref = testCases;
   1.181 +	while(ref) {
   1.182 +		SDL_free(ref->testName);
   1.183 +		SDL_free(ref->suiteName);
   1.184 +
   1.185 +		TestCase *temp = ref->next;
   1.186 +		SDL_free(ref);
   1.187 +		ref = temp;
   1.188 +	}
   1.189 +
   1.190 +	testCases = NULL;
   1.191 +}
   1.192 +
   1.193 +
   1.194 +/*!
   1.195 + * Filters a test case based on its properties in TestCaseReference and user
   1.196 + * preference.
   1.197 + *
   1.198 + * \return Non-zero means test will be added to execution list, zero means opposite
   1.199 + */
   1.200 +int
   1.201 +FilterTestCase(TestCaseReference *testReference)
   1.202 +{
   1.203 +	int retVal = 1;
   1.204 +
   1.205 +	if(testReference->enabled == TEST_DISABLED) {
   1.206 +		retVal = 0;
   1.207 +	}
   1.208 +
   1.209 +	if(only_tests_with_string) {
   1.210 +		if(strstr(testReference->name, testcase_name_substring) != NULL) {
   1.211 +			retVal = 1;
   1.212 +		} else {
   1.213 +			retVal = 0;
   1.214 +		}
   1.215 +	}
   1.216 +
   1.217 +	return retVal;
   1.218 +}
   1.219 +
   1.220 +
   1.221 +/*!
   1.222   * Loads test suite which is implemented as dynamic library.
   1.223   *
   1.224   * \param testSuiteName Name of the test suite which will be loaded
   1.225 @@ -175,29 +302,73 @@
   1.226  
   1.227  
   1.228  /*!
   1.229 + * Goes through all the given TestSuiteReferences
   1.230 + * and loads the dynamic libraries. Updates the suites
   1.231 + * parameter on-the-fly and returns it.
   1.232 + *
   1.233 + * \param suites Suites that will be loaded
   1.234 + *
   1.235 + * \return Updated TestSuiteReferences with pointer to loaded libraries
   1.236 + */
   1.237 +TestSuiteReference *
   1.238 +LoadTestSuites(TestSuiteReference *suites)
   1.239 +{
   1.240 +	TestSuiteReference *reference = NULL;
   1.241 +	for(reference = suites; reference; reference = reference->next) {
   1.242 +		reference->library = LoadTestSuite(reference->name);
   1.243 +	}
   1.244 +
   1.245 +	return suites;
   1.246 +}
   1.247 +
   1.248 +
   1.249 +/*!
   1.250 + * Unloads the given TestSuiteReferences. Frees all
   1.251 + * the allocated resources including the dynamic libraries.
   1.252 + *
   1.253 + * \param suites TestSuiteReferences for deallocation process
   1.254 + */
   1.255 +void
   1.256 +UnloadTestSuites(TestSuiteReference *suites)
   1.257 +{
   1.258 +	TestSuiteReference *ref = suites;
   1.259 +	while(ref) {
   1.260 +		SDL_free(ref->name);
   1.261 +		SDL_UnloadObject(ref->library);
   1.262 +
   1.263 +		TestSuiteReference *temp = ref->next;
   1.264 +		SDL_free(ref);
   1.265 +		ref = temp;
   1.266 +	}
   1.267 +
   1.268 +	suites = NULL;
   1.269 +}
   1.270 +
   1.271 +
   1.272 +/*!
   1.273   * Loads the test case references from the given test suite.
   1.274  
   1.275   * \param library Previously loaded dynamic library AKA test suite
   1.276   * \return Pointer to array of TestCaseReferences or NULL if function failed
   1.277   */
   1.278  TestCaseReference **
   1.279 -QueryTestCases(void *library)
   1.280 +QueryTestCaseReferences(void *library)
   1.281  {
   1.282 -	TestCaseReference **(*suite)(void);
   1.283 +        TestCaseReference **(*suite)(void);
   1.284  
   1.285 -	suite = (TestCaseReference **(*)(void)) SDL_LoadFunction(library, "QueryTestSuite");
   1.286 -	if(suite == NULL) {
   1.287 -		fprintf(stderr, "Loading QueryTestCaseReferences() failed.\n");
   1.288 -		fprintf(stderr, "%s\n", SDL_GetError());
   1.289 -	}
   1.290 +        suite = (TestCaseReference **(*)(void)) SDL_LoadFunction(library, "QueryTestSuite");
   1.291 +        if(suite == NULL) {
   1.292 +                fprintf(stderr, "Loading QueryTestCaseReferences() failed.\n");
   1.293 +                fprintf(stderr, "%s\n", SDL_GetError());
   1.294 +        }
   1.295  
   1.296 -	TestCaseReference **tests = suite();
   1.297 -	if(tests == NULL) {
   1.298 -		fprintf(stderr, "Failed to load test references.\n");
   1.299 -		fprintf(stderr, "%s\n", SDL_GetError());
   1.300 -	}
   1.301 +        TestCaseReference **tests = suite();
   1.302 +        if(tests == NULL) {
   1.303 +                fprintf(stderr, "Failed to load test references.\n");
   1.304 +                fprintf(stderr, "%s\n", SDL_GetError());
   1.305 +        }
   1.306  
   1.307 -	return tests;
   1.308 +        return tests;
   1.309  }
   1.310  
   1.311  
   1.312 @@ -209,10 +380,10 @@
   1.313   *
   1.314   * \return Function Pointer (TestCase) to loaded test case, NULL if function failed
   1.315   */
   1.316 -TestCase
   1.317 -LoadTestCase(void *suite, char *testName)
   1.318 +TestCaseFp
   1.319 +LoadTestCaseFunction(void *suite, char *testName)
   1.320  {
   1.321 -	TestCase test = (TestCase) SDL_LoadFunction(suite, testName);
   1.322 +	TestCaseFp test = (TestCaseFp) SDL_LoadFunction(suite, testName);
   1.323  	if(test == NULL) {
   1.324  		fprintf(stderr, "Loading test failed, tests == NULL\n");
   1.325  		fprintf(stderr, "%s\n", SDL_GetError());
   1.326 @@ -230,9 +401,9 @@
   1.327   *
   1.328   * \return Function pointer (TestCaseInit) which points to loaded init function. NULL if function fails.
   1.329   */
   1.330 -TestCaseInit
   1.331 -LoadTestCaseInit(void *suite) {
   1.332 -	TestCaseInit testCaseInit = (TestCaseInit) SDL_LoadFunction(suite, "_TestCaseInit");
   1.333 +TestCaseInitFp
   1.334 +LoadTestCaseInitFunction(void *suite) {
   1.335 +	TestCaseInitFp testCaseInit = (TestCaseInitFp) SDL_LoadFunction(suite, "_TestCaseInit");
   1.336  	if(testCaseInit == NULL) {
   1.337  		fprintf(stderr, "Loading TestCaseInit function failed, testCaseInit == NULL\n");
   1.338  		fprintf(stderr, "%s\n", SDL_GetError());
   1.339 @@ -250,9 +421,9 @@
   1.340   *
   1.341   * \return Function pointer (TestCaseInit) which points to loaded init function. NULL if function fails.
   1.342   */
   1.343 -TestCaseQuit
   1.344 -LoadTestCaseQuit(void *suite) {
   1.345 -	TestCaseQuit testCaseQuit = (TestCaseQuit) SDL_LoadFunction(suite, "_TestCaseQuit");
   1.346 +TestCaseQuitFp
   1.347 +LoadTestCaseQuitFunction(void *suite) {
   1.348 +	TestCaseQuitFp testCaseQuit = (TestCaseQuitFp) SDL_LoadFunction(suite, "_TestCaseQuit");
   1.349  	if(testCaseQuit == NULL) {
   1.350  		fprintf(stderr, "Loading TestCaseQuit function failed, testCaseQuit == NULL\n");
   1.351  		fprintf(stderr, "%s\n", SDL_GetError());
   1.352 @@ -273,9 +444,8 @@
   1.353   * \return 0 if test case succeeded, 1 otherwise
   1.354   */
   1.355  int
   1.356 -HandleTestReturnValue(int stat_lock)
   1.357 +HandleChildProcessReturnValue(int stat_lock)
   1.358  {
   1.359 -	//! \todo rename to: HandleChildProcessReturnValue?
   1.360  	int returnValue = -1;
   1.361  
   1.362  	if(WIFEXITED(stat_lock)) {
   1.363 @@ -299,7 +469,7 @@
   1.364   * \return The return value of the test. Zero means success, non-zero failure.
   1.365   */
   1.366  int
   1.367 -ExecuteTest(TestCaseItem *testItem) {
   1.368 +ExecuteTest(TestCase *testItem) {
   1.369  	int retVal = 1;
   1.370  	if(execute_inproc) {
   1.371  		testItem->testCaseInit();
   1.372 @@ -319,7 +489,7 @@
   1.373  			int stat_lock = -1;
   1.374  			int child = wait(&stat_lock);
   1.375  
   1.376 -			retVal = HandleTestReturnValue(stat_lock);
   1.377 +			retVal = HandleChildProcessReturnValue(stat_lock);
   1.378  		}
   1.379  	}
   1.380  
   1.381 @@ -334,10 +504,10 @@
   1.382  printUsage() {
   1.383  	  printf("Usage: ./runner [--in-proc] [--suite SUITE] [--test TEST] [--help]\n");
   1.384  	  printf("Options:\n");
   1.385 -	  printf("    --in-proc        Executes tests in-process\n");
   1.386 -	  printf(" -t --test TEST      Executes only tests with given name\n");
   1.387 -	  printf(" -s --suite SUITE    Executes only the given test suite\n");
   1.388 -	  //! \todo add --test-name-contains
   1.389 +	  printf("     --in-proc                           Executes tests in-process\n");
   1.390 +	  printf(" -t  --test TEST                         Executes only tests with given name\n");
   1.391 +	  printf(" -ts --test-name-contains SUBSTRING      Executes only tests which test name has the given substring\n");
   1.392 +	  printf(" -s  --suite SUITE    Executes only the given test suite\n");
   1.393  
   1.394  	  printf(" -h --help           Print this help\n");
   1.395  }
   1.396 @@ -418,130 +588,6 @@
   1.397  
   1.398  
   1.399  /*!
   1.400 - * \todo add comment
   1.401 - */
   1.402 -TestCaseItem *
   1.403 -LoadTestCases(TestSuiteReference *suites) {
   1.404 -	TestCaseItem *testCases = NULL;
   1.405 -
   1.406 -	TestSuiteReference *suiteReference = NULL;
   1.407 -	for(suiteReference = suites; suiteReference; suiteReference = suiteReference->next) {
   1.408 -		TestCaseReference **tests = QueryTestCases(suiteReference->library);
   1.409 -
   1.410 -		TestCaseReference *testReference = NULL;
   1.411 -		int counter = 0;
   1.412 -		for(testReference = tests[counter]; testReference; testReference = tests[++counter]) {
   1.413 -
   1.414 -			void *suite = suiteReference->library;
   1.415 -			// Load test case functions
   1.416 -			TestCaseInit testCaseInit = LoadTestCaseInit(suiteReference->library);
   1.417 -			TestCaseQuit testCaseQuit = LoadTestCaseQuit(suiteReference->library);
   1.418 -			TestCase testCase = (TestCase) LoadTestCase(suiteReference->library, testReference->name);
   1.419 -
   1.420 -			// Do the filtering
   1.421 -			if(FilterTestCase(testReference)) {
   1.422 -				TestCaseItem *item = SDL_malloc(sizeof(TestCaseItem));
   1.423 -				memset(item, 0, sizeof(TestCaseItem));
   1.424 -
   1.425 -				item->testCaseInit = testCaseInit;
   1.426 -				item->testCase = testCase;
   1.427 -				item->testCaseQuit = testCaseQuit;
   1.428 -
   1.429 -				int length = strlen(suiteReference->name) + 1;
   1.430 -				item->suiteName = SDL_malloc(length);
   1.431 -				strcpy(item->suiteName, suiteReference->name);
   1.432 -
   1.433 -				length = strlen(testReference->name) + 1;
   1.434 -				item->testName = SDL_malloc(length);
   1.435 -				strcpy(item->testName, testReference->name);
   1.436 -
   1.437 -				// prepend the list
   1.438 -				item->next = testCases;
   1.439 -				testCases = item;
   1.440 -
   1.441 -				printf("Added test: %s\n", testReference->name);
   1.442 -			}
   1.443 -		}
   1.444 -	}
   1.445 -
   1.446 -	return testCases;
   1.447 -}
   1.448 -
   1.449 -/*!
   1.450 - * \todo add comment
   1.451 - */
   1.452 -void
   1.453 -UnloadTestCases(TestCaseItem *item) {
   1.454 -	TestCaseItem *ref = item;
   1.455 -	while(ref) {
   1.456 -		SDL_free(ref->testName);
   1.457 -		SDL_free(ref->suiteName);
   1.458 -
   1.459 -		TestCaseItem *temp = ref->next;
   1.460 -		SDL_free(ref);
   1.461 -		ref = temp;
   1.462 -	}
   1.463 -
   1.464 -	item = NULL;
   1.465 -}
   1.466 -
   1.467 -/*!
   1.468 - * \todo add comment
   1.469 - *
   1.470 - * \return Non-zero means test will be added to execution list, zero means opposite
   1.471 - */
   1.472 -int
   1.473 -FilterTestCase(TestCaseReference *testReference) {
   1.474 -	int retVal = 1;
   1.475 -
   1.476 -	if(testReference->enabled == TEST_DISABLED) {
   1.477 -		retVal = 0;
   1.478 -	}
   1.479 -
   1.480 -	if(only_tests_with_string) {
   1.481 -		if(strstr(testReference->name, testcase_name_substring) != NULL) {
   1.482 -			retVal = 1;
   1.483 -		} else {
   1.484 -			retVal = 0;
   1.485 -		}
   1.486 -	}
   1.487 -
   1.488 -	return retVal;
   1.489 -}
   1.490 -
   1.491 -/*!
   1.492 - * \todo add comment
   1.493 - */
   1.494 -TestSuiteReference *
   1.495 -LoadTestSuites(TestSuiteReference *suites) {
   1.496 -	TestSuiteReference *reference = NULL;
   1.497 -	for(reference = suites; reference; reference = reference->next) {
   1.498 -		reference->library = LoadTestSuite(reference->name);
   1.499 -	}
   1.500 -
   1.501 -	return suites;
   1.502 -}
   1.503 -
   1.504 -
   1.505 -/*!
   1.506 - * \todo add comment
   1.507 - */
   1.508 -void UnloadTestSuites(TestSuiteReference *suites) {
   1.509 -	TestSuiteReference *ref = suites;
   1.510 -	while(ref) {
   1.511 -		SDL_free(ref->name);
   1.512 -		SDL_UnloadObject(ref->library);
   1.513 -
   1.514 -		TestSuiteReference *temp = ref->next;
   1.515 -		SDL_free(ref);
   1.516 -		ref = temp;
   1.517 -	}
   1.518 -
   1.519 -	suites = NULL;
   1.520 -}
   1.521 -
   1.522 -
   1.523 -/*!
   1.524   * Entry point for test runner
   1.525   *
   1.526   * \param argc Count of command line arguments
   1.527 @@ -569,16 +615,15 @@
   1.528  	TestSuiteReference *suites = ScanForTestSuites(DEFAULT_TEST_DIRECTORY, extension);
   1.529  	suites = LoadTestSuites(suites);
   1.530  
   1.531 -	TestCaseItem *testCases = LoadTestCases(suites);
   1.532 +	TestCase *testCases = LoadTestCases(suites);
   1.533  
   1.534 -	TestCaseItem *testItem = NULL;
   1.535 +	TestCase *testItem = NULL;
   1.536  	for(testItem = testCases; testItem; testItem = testItem->next) {
   1.537  		int retVal = ExecuteTest(testItem);
   1.538  
   1.539  		if(retVal) {
   1.540  			failureCount++;
   1.541  			if(retVal == 2) {
   1.542 -				//printf("%s (in %s): FAILED -> No asserts\n", reference->name, testSuiteName);
   1.543  				printf("%s (in %s): FAILED -> No asserts\n", testItem->testName, testItem->suiteName);
   1.544  			} else {
   1.545  				printf("%s (in %s): FAILED\n", testItem->testName, testItem->suiteName);
   1.546 @@ -601,6 +646,5 @@
   1.547  	printf("%d tests passed\n", passCount);
   1.548  	printf("%d tests failed\n", failureCount);
   1.549  
   1.550 -
   1.551  	return 0;
   1.552  }
     2.1 --- a/test/test-automation/testdummy/testdummy.c	Thu Jun 09 17:13:33 2011 +0300
     2.2 +++ b/test/test-automation/testdummy/testdummy.c	Thu Jun 09 18:07:50 2011 +0300
     2.3 @@ -56,27 +56,27 @@
     2.4  }
     2.5  
     2.6  /* Test case functions */
     2.7 -void dummycase1(void *arg)
     2.8 +void
     2.9 +dummycase1(void *arg)
    2.10  {
    2.11  	const char *revision = SDL_GetRevision();
    2.12  
    2.13 -	printf("Dummycase 1\n");
    2.14  	printf("Revision is %s\n", revision);
    2.15  
    2.16  	AssertEquals(3, 5, "fails");
    2.17  }
    2.18  
    2.19 -void dummycase2(void *arg)
    2.20 +void
    2.21 +dummycase2(void *arg)
    2.22  {
    2.23  	char *msg = "eello";
    2.24  	//msg[0] = 'H';
    2.25 -	printf("Dummycase 2\n");
    2.26  	AssertTrue(0, "fails");
    2.27  }
    2.28  
    2.29 -void dummycase3(void *arg)
    2.30 +void
    2.31 +dummycase3(void *arg)
    2.32  {
    2.33 -	printf("Dummycase 3\n");
    2.34  	AssertTrue(1, "passes");
    2.35  }
    2.36