Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix compiler warning; minor harness driver cleanup; fix test build fo…
Browse files Browse the repository at this point in the history
…r SDL versions compiled with --disable-joystick or --disable-haptic
  • Loading branch information
ferzkopp committed Dec 23, 2012
1 parent fa87ba5 commit 6ed6a46
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/test/SDL_test_harness.c
Expand Up @@ -502,7 +502,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
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);
Expand Down
6 changes: 1 addition & 5 deletions test/testautomation.c
Expand Up @@ -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)
Expand All @@ -46,9 +45,6 @@ main(int argc, char *argv[])
return 1;
}

// Needed?
// state->window_flags |= SDL_WINDOW_RESIZABLE;

/* Parse commandline */
for (i = 1; i < argc;) {
int consumed;
Expand Down Expand Up @@ -84,7 +80,7 @@ main(int argc, char *argv[])
}
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);
}
Expand Down
13 changes: 13 additions & 0 deletions test/testgamecontroller.c
Expand Up @@ -18,6 +18,8 @@

#include "SDL.h"

#ifndef SDL_JOYSTICK_DISABLED

#ifdef __IPHONEOS__
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 480
Expand Down Expand Up @@ -203,3 +205,14 @@ main(int argc, char *argv[])

return (0);
}

#else

int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Joystick support.\n");
exit(1);
}

#endif
19 changes: 16 additions & 3 deletions test/testhaptic.c
Expand Up @@ -26,13 +26,15 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* 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;

Expand Down Expand Up @@ -286,3 +288,14 @@ HapticPrintSupported(SDL_Haptic * haptic)
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
14 changes: 14 additions & 0 deletions test/testjoystick.c
Expand Up @@ -18,6 +18,8 @@

#include "SDL.h"

#ifndef SDL_JOYSTICK_DISABLED

#ifdef __IPHONEOS__
#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 480
Expand All @@ -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)
{
Expand Down Expand Up @@ -269,3 +272,14 @@ main(int argc, char *argv[])

return 0;
}

#else

int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Joystick support.\n");
exit(1);
}

#endif
18 changes: 15 additions & 3 deletions test/testrumble.c
Expand Up @@ -26,13 +26,15 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* 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;

Expand Down Expand Up @@ -142,3 +144,13 @@ main(int argc, char **argv)
return 0;
}

#else

int
main(int argc, char *argv[])
{
fprintf(stderr, "SDL compiled without Haptic support.\n");
exit(1);
}

#endif

0 comments on commit 6ed6a46

Please sign in to comment.