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:
parent
1b63b3fd52
commit
2e4dc511a0
6 changed files with 60 additions and 12 deletions
|
@ -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);
|
||||
|
|
|
@ -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 @@ main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
// Needed?
|
||||
// state->window_flags |= SDL_WINDOW_RESIZABLE;
|
||||
|
||||
/* Parse commandline */
|
||||
for (i = 1; i < argc;) {
|
||||
int consumed;
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 @@ 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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -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 @@ 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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue