Fix compiler warning; minor harness driver cleanup; fix test build for SDL versions compiled with --disable-joystick or --disable-haptic
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sat, 22 Dec 2012 20:43:51 -0800
changeset 6771 55337ff4256f
parent 6770 9a111d2aa992
child 6772 5229a117ef97
Fix compiler warning; minor harness driver cleanup; fix test build for SDL versions compiled with --disable-joystick or --disable-haptic
src/test/SDL_test_harness.c
test/testautomation.c
test/testgamecontroller.c
test/testhaptic.c
test/testjoystick.c
test/testrumble.c
--- a/src/test/SDL_test_harness.c	Sat Dec 22 20:13:25 2012 -0800
+++ b/src/test/SDL_test_harness.c	Sat Dec 22 20:43:51 2012 -0800
@@ -502,7 +502,7 @@
 						if (userExecKey != 0) {
 							execKey = userExecKey;
 						} else {
-							execKey = SDLTest_GenerateExecKey(runSeed, testSuite->name, testCase->name, iterationCounter);
+							execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
 						}
 
 						SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
--- a/test/testautomation.c	Sat Dec 22 20:13:25 2012 -0800
+++ b/test/testautomation.c	Sat Dec 22 20:43:51 2012 -0800
@@ -21,7 +21,6 @@
 
 static SDLTest_CommonState *state;
 
-
 /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
 static void
 quit(int rc)
@@ -46,9 +45,6 @@
         return 1;
     }
 
-    // Needed?
-    // state->window_flags |= SDL_WINDOW_RESIZABLE;
-
     /* Parse commandline */
     for (i = 1; i < argc;) {
         int consumed;
@@ -84,7 +80,7 @@
         }
         if (consumed < 0) {
             fprintf(stderr,
-                    "Usage: %s %s [--iterations #] [--execKey #] [--seed string]\n",
+                    "Usage: %s %s [--iterations #] [--execKey #] [--seed string] [--filter suite_name|test_name]\n",
                     argv[0], SDLTest_CommonUsage(state));
             quit(1);
         }
--- a/test/testgamecontroller.c	Sat Dec 22 20:13:25 2012 -0800
+++ b/test/testgamecontroller.c	Sat Dec 22 20:43:51 2012 -0800
@@ -18,6 +18,8 @@
 
 #include "SDL.h"
 
+#ifndef SDL_JOYSTICK_DISABLED
+
 #ifdef __IPHONEOS__
 #define SCREEN_WIDTH	320
 #define SCREEN_HEIGHT	480
@@ -203,3 +205,14 @@
 
     return (0);
 }
+
+#else
+
+int
+main(int argc, char *argv[])
+{
+    fprintf(stderr, "SDL compiled without Joystick support.\n");
+    exit(1);
+}
+
+#endif
--- a/test/testhaptic.c	Sat Dec 22 20:13:25 2012 -0800
+++ b/test/testhaptic.c	Sat Dec 22 20:43:51 2012 -0800
@@ -26,13 +26,15 @@
  * includes
  */
 #include <stdlib.h>
-#include "SDL.h"
-#include "SDL_haptic.h"
-
 #include <stdio.h>              /* printf */
 #include <string.h>             /* strstr */
 #include <ctype.h>              /* isdigit */
 
+#include "SDL.h"
+
+#ifndef SDL_HAPTIC_DISABLED
+
+#include "SDL_haptic.h"
 
 static SDL_Haptic *haptic;
 
@@ -286,3 +288,14 @@
     if (supported & SDL_HAPTIC_STATUS)
         printf("      status\n");
 }
+
+#else
+
+int
+main(int argc, char *argv[])
+{
+    fprintf(stderr, "SDL compiled without Haptic support.\n");
+    exit(1);
+}
+
+#endif
--- a/test/testjoystick.c	Sat Dec 22 20:13:25 2012 -0800
+++ b/test/testjoystick.c	Sat Dec 22 20:43:51 2012 -0800
@@ -18,6 +18,8 @@
 
 #include "SDL.h"
 
+#ifndef SDL_JOYSTICK_DISABLED
+
 #ifdef __IPHONEOS__
 #define SCREEN_WIDTH	320
 #define SCREEN_HEIGHT	480
@@ -29,6 +31,7 @@
 #define MAX_NUM_AXES 6
 #define MAX_NUM_HATS 2
 
+
 static void
 DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h)
 {
@@ -269,3 +272,14 @@
 
     return 0;
 }
+
+#else
+
+int
+main(int argc, char *argv[])
+{
+    fprintf(stderr, "SDL compiled without Joystick support.\n");
+    exit(1);
+}
+
+#endif
--- a/test/testrumble.c	Sat Dec 22 20:13:25 2012 -0800
+++ b/test/testrumble.c	Sat Dec 22 20:43:51 2012 -0800
@@ -26,13 +26,15 @@
  * includes
  */
 #include <stdlib.h>
-#include "SDL.h"
-#include "SDL_haptic.h"
-
 #include <stdio.h>              /* printf */
 #include <string.h>             /* strstr */
 #include <ctype.h>              /* isdigit */
 
+#include "SDL.h"
+
+#ifndef SDL_HAPTIC_DISABLED
+
+#include "SDL_haptic.h"
 
 static SDL_Haptic *haptic;
 
@@ -142,3 +144,13 @@
     return 0;
 }
 
+#else
+
+int
+main(int argc, char *argv[])
+{
+    fprintf(stderr, "SDL compiled without Haptic support.\n");
+    exit(1);
+}
+
+#endif