Commit c47e208c authored by Sam Lantinga's avatar Sam Lantinga

Moved the assertion tests to testplatform

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404414
parent 6bb89ae3
...@@ -181,20 +181,6 @@ SDL_Init(Uint32 flags) ...@@ -181,20 +181,6 @@ SDL_Init(Uint32 flags)
SDL_InstallParachute(); 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); return (0);
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "SDL.h" #include "SDL.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_cpuinfo.h" #include "SDL_cpuinfo.h"
#include "SDL_assert.h"
/* /*
* Watcom C flags these as Warning 201: "Unreachable code" if you just * Watcom C flags these as Warning 201: "Unreachable code" if you just
...@@ -148,6 +149,26 @@ TestCPUInfo(SDL_bool verbose) ...@@ -148,6 +149,26 @@ TestCPUInfo(SDL_bool verbose)
return (0); return (0);
} }
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 int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
...@@ -164,5 +185,7 @@ main(int argc, char *argv[]) ...@@ -164,5 +185,7 @@ main(int argc, char *argv[])
status += TestTypes(verbose); status += TestTypes(verbose);
status += TestEndian(verbose); status += TestEndian(verbose);
status += TestCPUInfo(verbose); status += TestCPUInfo(verbose);
status += TestAssertions(verbose);
return status; return status;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment