test/test-automation/SDL_test.c
changeset 5679 10a5199c4169
parent 5678 50401a6c3c95
child 5680 e61bdd43a2c3
equal deleted inserted replaced
5678:50401a6c3c95 5679:10a5199c4169
    45 
    45 
    46 int
    46 int
    47 _TestCaseQuit()
    47 _TestCaseQuit()
    48 {
    48 {
    49 	//! \todo make the test fail, if it does not contain any asserts
    49 	//! \todo make the test fail, if it does not contain any asserts
    50 	printf("Asserts: passed %d, failed %d\n", _testAssertsPassed, _testAssertsFailed);fflush(stdout);
    50 	printf("Asserts: passed %d, failed %d\n", _testAssertsPassed, _testAssertsFailed);
       
    51 	if(_testAssertsFailed == 0 && _testAssertsPassed == 0) {
       
    52 		_testReturnValue = 2;
       
    53 	}
       
    54 
    51 	return _testReturnValue;
    55 	return _testReturnValue;
    52 }
    56 }
    53 
    57 
    54 void
    58 void
    55 AssertEquals(Uint32 expected, Uint32 actual, char* message, ...)
    59 AssertEquals(Uint32 expected, Uint32 actual, char* message, ...)
    59 
    63 
    60    if(expected != actual) {
    64    if(expected != actual) {
    61       va_start( args, message );
    65       va_start( args, message );
    62       SDL_vsnprintf( buf, sizeof(buf), message, args );
    66       SDL_vsnprintf( buf, sizeof(buf), message, args );
    63       va_end( args );
    67       va_end( args );
    64       printf("Assert Equals failed: expected %d, got %d; %s\n", expected, actual, buf); fflush(stdout);
    68       printf("Assert Equals failed: expected %d, got %d; %s\n", expected, actual, buf);
    65       _testReturnValue = 1;
    69       _testReturnValue = 1;
    66       _testAssertsFailed++;
    70       _testAssertsFailed++;
    67    } else {
    71    } else {
    68       _testAssertsPassed++;
    72       _testAssertsPassed++;
    69    }
    73    }