1.1 --- a/test/test-automation/SDL_test.c Sat Jun 04 17:58:46 2011 +0300
1.2 +++ b/test/test-automation/SDL_test.c Sat Jun 04 18:08:54 2011 +0300
1.3 @@ -48,6 +48,7 @@
1.4 {
1.5 //! \todo make the test fail, if it does not contain any asserts
1.6 printf("Asserts: passed %d, failed %d\n", _testAssertsPassed, _testAssertsFailed);
1.7 +
1.8 if(_testAssertsFailed == 0 && _testAssertsPassed == 0) {
1.9 _testReturnValue = 2;
1.10 }
1.11 @@ -55,6 +56,15 @@
1.12 return _testReturnValue;
1.13 }
1.14
1.15 +
1.16 +/*!
1.17 + * Assert function. Tests if the expected value equals the actual value, then
1.18 + * the test assert succeeds, otherwise it fails and warns about it.
1.19 + *
1.20 + * \param expected Value user expects to have
1.21 + * \param actual The actual value of tested variable
1.22 + * \param message Message that will be printed if assert fails
1.23 + */
1.24 void
1.25 AssertEquals(Uint32 expected, Uint32 actual, char* message, ...)
1.26 {
1.27 @@ -73,6 +83,14 @@
1.28 }
1.29 }
1.30
1.31 +/*!
1.32 + * Assert function. Tests if the given condition is true. True in
1.33 + * this case means non-zero value. If the condition is true, the
1.34 + * assert passes, otherwise it fails.
1.35 + *
1.36 + * \param condition Condition which will be evaluated
1.37 + * \param message Message that will be printed if assert fails
1.38 + */
1.39 void
1.40 AssertTrue(int condition, char *message, ...)
1.41 {