mirror of https://github.com/encounter/SDL.git
Added missing brackets in test source assert messages.
This commit is contained in:
parent
e11969a72f
commit
743ba2f499
|
@ -92,7 +92,7 @@ int audio_initQuitAudio()
|
||||||
|
|
||||||
/* Loop over all available audio drivers */
|
/* Loop over all available audio drivers */
|
||||||
iMax = SDL_GetNumAudioDrivers();
|
iMax = SDL_GetNumAudioDrivers();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers");
|
SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()");
|
||||||
SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
|
SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
|
||||||
for (i = 0; i < iMax; i++) {
|
for (i = 0; i < iMax; i++) {
|
||||||
audioDriver = SDL_GetAudioDriver(i);
|
audioDriver = SDL_GetAudioDriver(i);
|
||||||
|
@ -149,7 +149,7 @@ int audio_initOpenCloseQuitAudio()
|
||||||
|
|
||||||
/* Loop over all available audio drivers */
|
/* Loop over all available audio drivers */
|
||||||
iMax = SDL_GetNumAudioDrivers();
|
iMax = SDL_GetNumAudioDrivers();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers");
|
SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()");
|
||||||
SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
|
SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
|
||||||
for (i = 0; i < iMax; i++) {
|
for (i = 0; i < iMax; i++) {
|
||||||
audioDriver = SDL_GetAudioDriver(i);
|
audioDriver = SDL_GetAudioDriver(i);
|
||||||
|
@ -238,7 +238,7 @@ int audio_pauseUnpauseAudio()
|
||||||
|
|
||||||
/* Loop over all available audio drivers */
|
/* Loop over all available audio drivers */
|
||||||
iMax = SDL_GetNumAudioDrivers();
|
iMax = SDL_GetNumAudioDrivers();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers");
|
SDLTest_AssertPass("Call to SDL_GetNumAudioDrivers()");
|
||||||
SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
|
SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
|
||||||
for (i = 0; i < iMax; i++) {
|
for (i = 0; i < iMax; i++) {
|
||||||
audioDriver = SDL_GetAudioDriver(i);
|
audioDriver = SDL_GetAudioDriver(i);
|
||||||
|
|
|
@ -647,22 +647,22 @@ rwops_testFileWriteReadEndian(void)
|
||||||
|
|
||||||
/* Write test data */
|
/* Write test data */
|
||||||
objectsWritten = SDL_WriteBE16(rw, BE16value);
|
objectsWritten = SDL_WriteBE16(rw, BE16value);
|
||||||
SDLTest_AssertPass("Call to SDL_WriteBE16");
|
SDLTest_AssertPass("Call to SDL_WriteBE16()");
|
||||||
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
||||||
objectsWritten = SDL_WriteBE32(rw, BE32value);
|
objectsWritten = SDL_WriteBE32(rw, BE32value);
|
||||||
SDLTest_AssertPass("Call to SDL_WriteBE32");
|
SDLTest_AssertPass("Call to SDL_WriteBE32()");
|
||||||
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
||||||
objectsWritten = SDL_WriteBE64(rw, BE64value);
|
objectsWritten = SDL_WriteBE64(rw, BE64value);
|
||||||
SDLTest_AssertPass("Call to SDL_WriteBE64");
|
SDLTest_AssertPass("Call to SDL_WriteBE64()");
|
||||||
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
||||||
objectsWritten = SDL_WriteLE16(rw, LE16value);
|
objectsWritten = SDL_WriteLE16(rw, LE16value);
|
||||||
SDLTest_AssertPass("Call to SDL_WriteLE16");
|
SDLTest_AssertPass("Call to SDL_WriteLE16()");
|
||||||
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
||||||
objectsWritten = SDL_WriteLE32(rw, LE32value);
|
objectsWritten = SDL_WriteLE32(rw, LE32value);
|
||||||
SDLTest_AssertPass("Call to SDL_WriteLE32");
|
SDLTest_AssertPass("Call to SDL_WriteLE32()");
|
||||||
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
||||||
objectsWritten = SDL_WriteLE64(rw, LE64value);
|
objectsWritten = SDL_WriteLE64(rw, LE64value);
|
||||||
SDLTest_AssertPass("Call to SDL_WriteLE64");
|
SDLTest_AssertPass("Call to SDL_WriteLE64()");
|
||||||
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
SDLTest_AssertCheck(objectsWritten == 1, "Validate number of objects written, expected: 1, got: %i", objectsWritten);
|
||||||
|
|
||||||
/* Test seek to start */
|
/* Test seek to start */
|
||||||
|
@ -672,22 +672,22 @@ rwops_testFileWriteReadEndian(void)
|
||||||
|
|
||||||
/* Read test data */
|
/* Read test data */
|
||||||
BE16test = SDL_ReadBE16(rw);
|
BE16test = SDL_ReadBE16(rw);
|
||||||
SDLTest_AssertPass("Call to SDL_ReadBE16");
|
SDLTest_AssertPass("Call to SDL_ReadBE16()");
|
||||||
SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test);
|
SDLTest_AssertCheck(BE16test == BE16value, "Validate return value from SDL_ReadBE16, expected: %hu, got: %hu", BE16value, BE16test);
|
||||||
BE32test = SDL_ReadBE32(rw);
|
BE32test = SDL_ReadBE32(rw);
|
||||||
SDLTest_AssertPass("Call to SDL_ReadBE32");
|
SDLTest_AssertPass("Call to SDL_ReadBE32()");
|
||||||
SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test);
|
SDLTest_AssertCheck(BE32test == BE32value, "Validate return value from SDL_ReadBE32, expected: %u, got: %u", BE32value, BE32test);
|
||||||
BE64test = SDL_ReadBE64(rw);
|
BE64test = SDL_ReadBE64(rw);
|
||||||
SDLTest_AssertPass("Call to SDL_ReadBE64");
|
SDLTest_AssertPass("Call to SDL_ReadBE64()");
|
||||||
SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %llu, got: %llu", BE64value, BE64test);
|
SDLTest_AssertCheck(BE64test == BE64value, "Validate return value from SDL_ReadBE64, expected: %llu, got: %llu", BE64value, BE64test);
|
||||||
LE16test = SDL_ReadLE16(rw);
|
LE16test = SDL_ReadLE16(rw);
|
||||||
SDLTest_AssertPass("Call to SDL_ReadLE16");
|
SDLTest_AssertPass("Call to SDL_ReadLE16()");
|
||||||
SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test);
|
SDLTest_AssertCheck(LE16test == LE16value, "Validate return value from SDL_ReadLE16, expected: %hu, got: %hu", LE16value, LE16test);
|
||||||
LE32test = SDL_ReadLE32(rw);
|
LE32test = SDL_ReadLE32(rw);
|
||||||
SDLTest_AssertPass("Call to SDL_ReadLE32");
|
SDLTest_AssertPass("Call to SDL_ReadLE32()");
|
||||||
SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test);
|
SDLTest_AssertCheck(LE32test == LE32value, "Validate return value from SDL_ReadLE32, expected: %u, got: %u", LE32value, LE32test);
|
||||||
LE64test = SDL_ReadLE64(rw);
|
LE64test = SDL_ReadLE64(rw);
|
||||||
SDLTest_AssertPass("Call to SDL_ReadLE64");
|
SDLTest_AssertPass("Call to SDL_ReadLE64()");
|
||||||
SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %llu, got: %llu", LE64value, LE64test);
|
SDLTest_AssertCheck(LE64test == LE64value, "Validate return value from SDL_ReadLE64, expected: %llu, got: %llu", LE64value, LE64test);
|
||||||
|
|
||||||
/* Close handle */
|
/* Close handle */
|
||||||
|
|
|
@ -32,7 +32,7 @@ syswm_getWindowWMInfo(void *arg)
|
||||||
|
|
||||||
/* Make call */
|
/* Make call */
|
||||||
result = SDL_GetWindowWMInfo(window, &info);
|
result = SDL_GetWindowWMInfo(window, &info);
|
||||||
SDLTest_AssertPass("Call to SDL_GetWindowWMInfo");
|
SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()");
|
||||||
SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
|
SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
|
||||||
|
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
|
|
|
@ -51,7 +51,7 @@ void _destroyVideoSuiteTestWindow(SDL_Window *window)
|
||||||
if (window != NULL) {
|
if (window != NULL) {
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
window = NULL;
|
window = NULL;
|
||||||
SDLTest_AssertPass("Call to SDL_DestroyWindow");
|
SDLTest_AssertPass("Call to SDL_DestroyWindow()");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ video_getWindowFlags(void *arg)
|
||||||
window = _createVideoSuiteTestWindow(title);
|
window = _createVideoSuiteTestWindow(title);
|
||||||
if (window != NULL) {
|
if (window != NULL) {
|
||||||
actualFlags = SDL_GetWindowFlags(window);
|
actualFlags = SDL_GetWindowFlags(window);
|
||||||
SDLTest_AssertPass("Call to SDL_GetWindowFlags");
|
SDLTest_AssertPass("Call to SDL_GetWindowFlags()");
|
||||||
SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %d", flags, actualFlags);
|
SDLTest_AssertCheck((flags & actualFlags) == flags, "Verify returned value has flags %d set, got: %d", flags, actualFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ video_getNumDisplayModes(void *arg)
|
||||||
|
|
||||||
/* Get number of displays */
|
/* Get number of displays */
|
||||||
displayNum = SDL_GetNumVideoDisplays();
|
displayNum = SDL_GetNumVideoDisplays();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
|
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");
|
||||||
|
|
||||||
/* Make call for each display */
|
/* Make call for each display */
|
||||||
for (i=0; i<displayNum; i++) {
|
for (i=0; i<displayNum; i++) {
|
||||||
|
@ -388,7 +388,7 @@ video_getNumDisplayModesNegative(void *arg)
|
||||||
|
|
||||||
/* Get number of displays */
|
/* Get number of displays */
|
||||||
displayNum = SDL_GetNumVideoDisplays();
|
displayNum = SDL_GetNumVideoDisplays();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
|
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");
|
||||||
|
|
||||||
/* Invalid boundary values */
|
/* Invalid boundary values */
|
||||||
displayIndex = SDLTest_RandomSint32BoundaryValue(0, displayNum, SDL_FALSE);
|
displayIndex = SDLTest_RandomSint32BoundaryValue(0, displayNum, SDL_FALSE);
|
||||||
|
@ -427,7 +427,7 @@ video_getClosestDisplayModeCurrentResolution(void *arg)
|
||||||
|
|
||||||
/* Get number of displays */
|
/* Get number of displays */
|
||||||
displayNum = SDL_GetNumVideoDisplays();
|
displayNum = SDL_GetNumVideoDisplays();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
|
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");
|
||||||
|
|
||||||
/* Make calls for each display */
|
/* Make calls for each display */
|
||||||
for (i=0; i<displayNum; i++) {
|
for (i=0; i<displayNum; i++) {
|
||||||
|
@ -435,7 +435,7 @@ video_getClosestDisplayModeCurrentResolution(void *arg)
|
||||||
|
|
||||||
/* Get first display mode to get a sane resolution; this should always work */
|
/* Get first display mode to get a sane resolution; this should always work */
|
||||||
result = SDL_GetDisplayMode(i, 0, ¤t);
|
result = SDL_GetDisplayMode(i, 0, ¤t);
|
||||||
SDLTest_AssertPass("Call to SDL_GetDisplayMode");
|
SDLTest_AssertPass("Call to SDL_GetDisplayMode()");
|
||||||
SDLTest_AssertCheck(result == 0, "Verify return value, expected: 0, got: %d", result);
|
SDLTest_AssertCheck(result == 0, "Verify return value, expected: 0, got: %d", result);
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
return TEST_ABORTED;
|
return TEST_ABORTED;
|
||||||
|
@ -481,7 +481,7 @@ video_getClosestDisplayModeRandomResolution(void *arg)
|
||||||
|
|
||||||
/* Get number of displays */
|
/* Get number of displays */
|
||||||
displayNum = SDL_GetNumVideoDisplays();
|
displayNum = SDL_GetNumVideoDisplays();
|
||||||
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
|
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");
|
||||||
|
|
||||||
/* Make calls for each display */
|
/* Make calls for each display */
|
||||||
for (i=0; i<displayNum; i++) {
|
for (i=0; i<displayNum; i++) {
|
||||||
|
@ -521,7 +521,7 @@ video_getWindowBrightness(void *arg)
|
||||||
window = _createVideoSuiteTestWindow(title);
|
window = _createVideoSuiteTestWindow(title);
|
||||||
if (window != NULL) {
|
if (window != NULL) {
|
||||||
result = SDL_GetWindowBrightness(window);
|
result = SDL_GetWindowBrightness(window);
|
||||||
SDLTest_AssertPass("Call to SDL_GetWindowBrightness");
|
SDLTest_AssertPass("Call to SDL_GetWindowBrightness()");
|
||||||
SDLTest_AssertCheck(result >= 0.0 && result <= 1.0, "Validate range of result value; expected: [0.0, 1.0], got: %f", result);
|
SDLTest_AssertCheck(result >= 0.0 && result <= 1.0, "Validate range of result value; expected: [0.0, 1.0], got: %f", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ video_getWindowDisplayMode(void *arg)
|
||||||
window = _createVideoSuiteTestWindow(title);
|
window = _createVideoSuiteTestWindow(title);
|
||||||
if (window != NULL) {
|
if (window != NULL) {
|
||||||
result = SDL_GetWindowDisplayMode(window, &mode);
|
result = SDL_GetWindowDisplayMode(window, &mode);
|
||||||
SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode");
|
SDLTest_AssertPass("Call to SDL_GetWindowDisplayMode()");
|
||||||
SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result);
|
SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0, got: %d", result);
|
||||||
SDLTest_AssertCheck(mode.w > 0, "Validate mode.w content; expected: >0, got: %d", mode.w);
|
SDLTest_AssertCheck(mode.w > 0, "Validate mode.w content; expected: >0, got: %d", mode.w);
|
||||||
SDLTest_AssertCheck(mode.h > 0, "Validate mode.h content; expected: >0, got: %d", mode.h);
|
SDLTest_AssertCheck(mode.h > 0, "Validate mode.h content; expected: >0, got: %d", mode.h);
|
||||||
|
|
Loading…
Reference in New Issue