From 65d4f2bfe5e63e11b41990426c6aaea735e3e28d Mon Sep 17 00:00:00 2001 From: Edgar Simo Date: Thu, 6 Aug 2009 08:39:42 +0000 Subject: [PATCH] More debugging information when test fails. --- test/automated/platform/platform.c | 83 +++++++++++++++++------------- test/automated/platform/platform.h | 1 + test/automated/render/render.c | 11 ++-- test/automated/testsdl.c | 39 ++++++++++++-- 4 files changed, 88 insertions(+), 46 deletions(-) diff --git a/test/automated/platform/platform.c b/test/automated/platform/platform.c index 376e19eae..c0a180d24 100644 --- a/test/automated/platform/platform.c +++ b/test/automated/platform/platform.c @@ -132,71 +132,80 @@ static void plat_testEndian (void) /** - * @brief Platform test entrypoint. + * @brief Gets the name of the platform. */ -#ifdef TEST_STANDALONE -int main( int argc, const char *argv[] ) +const char *platform_getPlatform (void) { - (void) argc; - (void) argv; -#else /* TEST_STANDALONE */ -int test_platform (void) -{ -#endif /* TEST_STANDALONE */ - - SDL_ATinit( "Platform" ); - - /* Debug information. */ - SDL_ATprintVerbose( 1, "%s System detected\n", + return #if __AIX__ - "AIX" + "AIX" #elif __BEOS__ - "BeOS" + "BeOS" #elif __BSDI__ - "BSDI" + "BSDI" #elif __DREAMCAST__ - "Dreamcast" + "Dreamcast" #elif __FREEBSD__ - "FreeBSD" + "FreeBSD" #elif __HPUX__ - "HP-UX" + "HP-UX" #elif __IRIX__ - "Irix" + "Irix" #elif __LINUX__ - "Linux" + "Linux" #elif __MINT__ - "Atari MiNT" + "Atari MiNT" #elif __MACOS__ - "MacOS Classic" + "MacOS Classic" #elif __MACOSX__ - "Mac OS X" + "Mac OS X" #elif __NETBSD__ - "NetBSD" + "NetBSD" #elif __OPENBSD__ - "OpenBSD" + "OpenBSD" #elif __OS2__ - "OS/2" + "OS/2" #elif __OSF__ - "OSF/1" + "OSF/1" #elif __QNXNTO__ - "QNX Neutrino" + "QNX Neutrino" #elif __RISCOS__ - "RISC OS" + "RISC OS" #elif __SOLARIS__ - "Solaris" + "Solaris" #elif __WIN32__ #ifdef _WIN32_WCE - "Windows CE" + "Windows CE" #else - "Windows" + "Windows" #endif #elif __IPHONEOS__ - "iPhone OS" + "iPhone OS" #else - "an unknown operating system! (see SDL_platform.h)" + "an unknown operating system! (see SDL_platform.h)" #endif - ); + ; +} + + +/** + * @brief Platform test entrypoint. + */ +#ifdef TEST_STANDALONE +int main( int argc, const char *argv[] ) +{ + (void) argc; + (void) argv; +#else /* TEST_STANDALONE */ +int test_platform (void) +{ +#endif /* TEST_STANDALONE */ + + SDL_ATinit( "Platform" ); + + /* Debug information. */ + SDL_ATprintVerbose( 1, "%s System detected\n", platform_getPlatform() ); SDL_ATprintVerbose( 1, "System is %s endian\n", #ifdef SDL_LIL_ENDIAN "little" diff --git a/test/automated/platform/platform.h b/test/automated/platform/platform.h index d8310e0c0..bb7e3499c 100644 --- a/test/automated/platform/platform.h +++ b/test/automated/platform/platform.h @@ -11,6 +11,7 @@ # define _TEST_PLATFORM +const char *platform_getPlatform (void); int test_platform (void); diff --git a/test/automated/render/render.c b/test/automated/render/render.c index 4ba4efcb1..9678bbae8 100644 --- a/test/automated/render/render.c +++ b/test/automated/render/render.c @@ -970,6 +970,7 @@ int main( int argc, const char *argv[] ) int test_render (void) { #endif /* TEST_STANDALONE */ + int failed; int i, j, nd, nr; int ret; const char *driver, *str; @@ -997,6 +998,7 @@ int test_render (void) * Surface on video mode tests. */ /* Run for all video modes. */ + failed = 0; for (i=0; i 0) { + SDL_ATprintErr( "Tests run with SDL %d.%d.%d revision %d\n", + ver.major, ver.minor, ver.patch, rev ); + SDL_ATprintErr( "System is running %s and is %s endian\n", + platform_getPlatform(), +#ifdef SDL_LIL_ENDIAN + "little" +#else + "big" +#endif + ); + } + + return failed; }