Mercurial > sdl-ios-xcode
comparison test/automated/render/render.c @ 3753:5b48a529fd8a gsoc2009_unit_tests
More debugging information when test fails.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Thu, 06 Aug 2009 08:39:42 +0000 |
parents | f7a3a47e6b50 |
children |
comparison
equal
deleted
inserted
replaced
3752:f47658c8f87a | 3753:5b48a529fd8a |
---|---|
968 (void) argv; | 968 (void) argv; |
969 #else /* TEST_STANDALONE */ | 969 #else /* TEST_STANDALONE */ |
970 int test_render (void) | 970 int test_render (void) |
971 { | 971 { |
972 #endif /* TEST_STANDALONE */ | 972 #endif /* TEST_STANDALONE */ |
973 int failed; | |
973 int i, j, nd, nr; | 974 int i, j, nd, nr; |
974 int ret; | 975 int ret; |
975 const char *driver, *str; | 976 const char *driver, *str; |
976 char msg[256]; | 977 char msg[256]; |
977 SDL_WindowID wid; | 978 SDL_WindowID wid; |
995 | 996 |
996 /* | 997 /* |
997 * Surface on video mode tests. | 998 * Surface on video mode tests. |
998 */ | 999 */ |
999 /* Run for all video modes. */ | 1000 /* Run for all video modes. */ |
1001 failed = 0; | |
1000 for (i=0; i<nd; i++) { | 1002 for (i=0; i<nd; i++) { |
1001 /* Get video mode. */ | 1003 /* Get video mode. */ |
1002 driver = SDL_GetVideoDriver(i); | 1004 driver = SDL_GetVideoDriver(i); |
1003 if (driver == NULL) | 1005 if (driver == NULL) |
1004 goto err; | 1006 goto err; |
1056 goto err; | 1058 goto err; |
1057 | 1059 |
1058 /* | 1060 /* |
1059 * Run tests. | 1061 * Run tests. |
1060 */ | 1062 */ |
1061 if (render_runTests()) | 1063 ret = render_runTests(); |
1064 if (ret) | |
1062 continue; | 1065 continue; |
1063 | 1066 |
1064 SDL_ATend(); | 1067 SDL_ATend(); |
1065 } | 1068 } |
1066 | 1069 |
1068 SDL_VideoQuit(); | 1071 SDL_VideoQuit(); |
1069 | 1072 |
1070 /* | 1073 /* |
1071 * Finish testsuite. | 1074 * Finish testsuite. |
1072 */ | 1075 */ |
1073 SDL_ATfinish(); | 1076 failed += SDL_ATfinish(); |
1074 } | 1077 } |
1075 | 1078 |
1076 | 1079 |
1077 /* Exit SDL. */ | 1080 /* Exit SDL. */ |
1078 SDL_Quit(); | 1081 SDL_Quit(); |
1079 | 1082 |
1080 return 0; | 1083 return failed; |
1081 | 1084 |
1082 err: | 1085 err: |
1083 return -1; | 1086 return 1; |
1084 } | 1087 } |
1085 | 1088 |