Fix compiler warning; minor harness driver cleanup; fix test build for SDL versions compiled with --disable-joystick or --disable-haptic

This commit is contained in:
Andreas Schiffler 2012-12-22 20:43:51 -08:00
parent 1b63b3fd52
commit 2e4dc511a0
6 changed files with 60 additions and 12 deletions

View file

@ -502,7 +502,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
if (userExecKey != 0) { if (userExecKey != 0) {
execKey = userExecKey; execKey = userExecKey;
} else { } 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); SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);

View file

@ -21,7 +21,6 @@
static SDLTest_CommonState *state; static SDLTest_CommonState *state;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void
quit(int rc) quit(int rc)
@ -46,9 +45,6 @@ main(int argc, char *argv[])
return 1; return 1;
} }
// Needed?
// state->window_flags |= SDL_WINDOW_RESIZABLE;
/* Parse commandline */ /* Parse commandline */
for (i = 1; i < argc;) { for (i = 1; i < argc;) {
int consumed; int consumed;
@ -84,7 +80,7 @@ main(int argc, char *argv[])
} }
if (consumed < 0) { if (consumed < 0) {
fprintf(stderr, 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)); argv[0], SDLTest_CommonUsage(state));
quit(1); quit(1);
} }

View file

@ -18,6 +18,8 @@
#include "SDL.h" #include "SDL.h"
#ifndef SDL_JOYSTICK_DISABLED
#ifdef __IPHONEOS__ #ifdef __IPHONEOS__
#define SCREEN_WIDTH 320 #define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 480 #define SCREEN_HEIGHT 480
@ -203,3 +205,14 @@ main(int argc, char *argv[])
return (0); return (0);
} }
#else
int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Joystick support.\n");
exit(1);
}
#endif

View file

@ -26,13 +26,15 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* includes * includes
*/ */
#include <stdlib.h> #include <stdlib.h>
#include "SDL.h"
#include "SDL_haptic.h"
#include <stdio.h> /* printf */ #include <stdio.h> /* printf */
#include <string.h> /* strstr */ #include <string.h> /* strstr */
#include <ctype.h> /* isdigit */ #include <ctype.h> /* isdigit */
#include "SDL.h"
#ifndef SDL_HAPTIC_DISABLED
#include "SDL_haptic.h"
static SDL_Haptic *haptic; static SDL_Haptic *haptic;
@ -286,3 +288,14 @@ HapticPrintSupported(SDL_Haptic * haptic)
if (supported & SDL_HAPTIC_STATUS) if (supported & SDL_HAPTIC_STATUS)
printf(" status\n"); printf(" status\n");
} }
#else
int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Haptic support.\n");
exit(1);
}
#endif

View file

@ -18,6 +18,8 @@
#include "SDL.h" #include "SDL.h"
#ifndef SDL_JOYSTICK_DISABLED
#ifdef __IPHONEOS__ #ifdef __IPHONEOS__
#define SCREEN_WIDTH 320 #define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 480 #define SCREEN_HEIGHT 480
@ -29,6 +31,7 @@
#define MAX_NUM_AXES 6 #define MAX_NUM_AXES 6
#define MAX_NUM_HATS 2 #define MAX_NUM_HATS 2
static void static void
DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h) DrawRect(SDL_Renderer *r, const int x, const int y, const int w, const int h)
{ {
@ -269,3 +272,14 @@ main(int argc, char *argv[])
return 0; return 0;
} }
#else
int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Joystick support.\n");
exit(1);
}
#endif

View file

@ -26,13 +26,15 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* includes * includes
*/ */
#include <stdlib.h> #include <stdlib.h>
#include "SDL.h"
#include "SDL_haptic.h"
#include <stdio.h> /* printf */ #include <stdio.h> /* printf */
#include <string.h> /* strstr */ #include <string.h> /* strstr */
#include <ctype.h> /* isdigit */ #include <ctype.h> /* isdigit */
#include "SDL.h"
#ifndef SDL_HAPTIC_DISABLED
#include "SDL_haptic.h"
static SDL_Haptic *haptic; static SDL_Haptic *haptic;
@ -142,3 +144,13 @@ main(int argc, char **argv)
return 0; return 0;
} }
#else
int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Haptic support.\n");
exit(1);
}
#endif