char *platform;
char *revision;
int ret;
- int len;
+ size_t len;
platform = (char *)SDL_GetPlatform();
SDLTest_AssertPass("SDL_GetPlatform()");
SDLTest_AssertCheck(len > 0,
"SDL_GetPlatform(): expected non-empty platform, was platform: '%s', len: %i",
platform,
- len);
+ (int) len);
}
ret = SDL_GetCPUCount();
int subsystem;
subsystem = SDL_WasInit(SDL_INIT_EVERYTHING);
- SDLTest_AssertCheck( subsystem != 0,
+ SDLTest_AssertCheck( subsystem == 0,
"SDL_WasInit(0): returned %i, expected != 0",
subsystem);
int result;
const char *testError = "Testing";
char *lastError;
- int len;
+ size_t len;
SDL_ClearError();
SDLTest_AssertPass("SDL_ClearError()");
{
len = SDL_strlen(lastError);
SDLTest_AssertCheck(len == 0,
- "SDL_GetError(): no message expected, len: %i", len);
+ "SDL_GetError(): no message expected, len: %i", (int) len);
}
result = SDL_SetError("%s", testError);
len = SDL_strlen(lastError);
SDLTest_AssertCheck(len == SDL_strlen(testError),
"SDL_GetError(): expected message len %i, was len: %i",
- SDL_strlen(testError),
- len);
+ (int) SDL_strlen(testError),
+ (int) len);
SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
"SDL_GetError(): expected message %s, was message: %s",
testError,
int result;
const char *testError = "";
char *lastError;
- int len;
+ size_t len;
result = SDL_SetError("%s", testError);
SDLTest_AssertPass("SDL_SetError()");
len = SDL_strlen(lastError);
SDLTest_AssertCheck(len == SDL_strlen(testError),
"SDL_GetError(): expected message len %i, was len: %i",
- SDL_strlen(testError),
- len);
+ (int) SDL_strlen(testError),
+ (int) len);
SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
"SDL_GetError(): expected message '%s', was message: '%s'",
testError,
const char *invalidError = NULL;
const char *probeError = "Testing";
char *lastError;
- int len;
+ size_t len;
/* Reset */
SDL_ClearError();
SDLTest_AssertPass("SDL_ClearError()");
/* Check for no-op */
- result = SDL_SetError(invalidError);
+ result = SDL_SetError("%s", invalidError);
SDLTest_AssertPass("SDL_SetError()");
SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
lastError = (char *)SDL_GetError();
len = SDL_strlen(lastError);
SDLTest_AssertCheck(len == 0,
"SDL_GetError(): expected message len 0, was len: %i",
- len);
+ (int) len);
}
/* Set */
- result = SDL_SetError(probeError);
+ result = SDL_SetError("%s", probeError);
SDLTest_AssertPass("SDL_SetError('%s')", probeError);
SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
/* Check for no-op */
- result = SDL_SetError(invalidError);
+ result = SDL_SetError("%s", invalidError);
SDLTest_AssertPass("SDL_SetError(NULL)");
SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
lastError = (char *)SDL_GetError();
len = SDL_strlen(lastError);
SDLTest_AssertCheck(len == 0,
"SDL_GetError(): expected message len 0, was len: %i",
- len);
+ (int) len);
}
/* Reset */
SDLTest_AssertPass("SDL_ClearError()");
/* Set and check */
- result = SDL_SetError(probeError);
+ result = SDL_SetError("%s", probeError);
SDLTest_AssertPass("SDL_SetError()");
SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
lastError = (char *)SDL_GetError();
len = SDL_strlen(lastError);
SDLTest_AssertCheck(len == SDL_strlen(probeError),
"SDL_GetError(): expected message len %i, was len: %i",
- SDL_strlen(probeError),
- len);
+ (int) SDL_strlen(probeError),
+ (int) len);
SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0,
"SDL_GetError(): expected message '%s', was message: '%s'",
probeError,
{ (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED};
static const SDLTest_TestCaseReference platformTest11 =
- { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED };
+ { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_DISABLED };
/* Sequence of Platform test cases */
static const SDLTest_TestCaseReference *platformTests[] = {