# HG changeset patch # User Sam Lantinga # Date 1263376122 0 # Node ID bc50cd16bb07558f753a29e922e8da20cf737f20 # Parent 6a0b3048f271772010b5d4bc91684388c6ede954 Moved the assertion tests to testplatform diff -r 6a0b3048f271 -r bc50cd16bb07 src/SDL.c --- a/src/SDL.c Wed Jan 13 09:44:17 2010 +0000 +++ b/src/SDL.c Wed Jan 13 09:48:42 2010 +0000 @@ -181,20 +181,6 @@ SDL_InstallParachute(); } - /* brief sanity checks for the sanity checks. :) */ - SDL_assert(1); - SDL_assert_release(1); - SDL_assert_paranoid(1); - SDL_assert(0 || 1); - SDL_assert_release(0 || 1); - SDL_assert_paranoid(0 || 1); - -#if 0 /* enable this to test assertion failures. */ - SDL_assert_release(1 == 2); - SDL_assert_release(5 < 4); - SDL_assert_release(0 && "This is a test"); -#endif - return (0); } diff -r 6a0b3048f271 -r bc50cd16bb07 test/testplatform.c --- a/test/testplatform.c Wed Jan 13 09:44:17 2010 +0000 +++ b/test/testplatform.c Wed Jan 13 09:48:42 2010 +0000 @@ -4,6 +4,7 @@ #include "SDL.h" #include "SDL_endian.h" #include "SDL_cpuinfo.h" +#include "SDL_assert.h" /* * Watcom C flags these as Warning 201: "Unreachable code" if you just @@ -149,6 +150,26 @@ } int +TestAssertions(SDL_bool verbose) +{ + SDL_assert(1); + SDL_assert_release(1); + SDL_assert_paranoid(1); + SDL_assert(0 || 1); + SDL_assert_release(0 || 1); + SDL_assert_paranoid(0 || 1); + +#if 0 /* enable this to test assertion failures. */ + SDL_assert_release(1 == 2); + SDL_assert_release(5 < 4); + SDL_assert_release(0 && "This is a test"); +#endif + SDL_assert_release(0 && "This is a test"); + + return (0); +} + +int main(int argc, char *argv[]) { SDL_bool verbose = SDL_TRUE; @@ -164,5 +185,7 @@ status += TestTypes(verbose); status += TestEndian(verbose); status += TestCPUInfo(verbose); + status += TestAssertions(verbose); + return status; }