Skip to content

Commit

Permalink
Added missing brackets in test source assert messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed Nov 7, 2014
1 parent e11969a commit 743ba2f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions test/testautomation_audio.c
Expand Up @@ -92,7 +92,7 @@ int audio_initQuitAudio()

/* Loop over all available audio drivers */
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);
for (i = 0; i < iMax; i++) {
audioDriver = SDL_GetAudioDriver(i);
Expand Down Expand Up @@ -149,7 +149,7 @@ int audio_initOpenCloseQuitAudio()

/* Loop over all available audio drivers */
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);
for (i = 0; i < iMax; i++) {
audioDriver = SDL_GetAudioDriver(i);
Expand Down Expand Up @@ -238,7 +238,7 @@ int audio_pauseUnpauseAudio()

/* Loop over all available audio drivers */
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);
for (i = 0; i < iMax; i++) {
audioDriver = SDL_GetAudioDriver(i);
Expand Down
24 changes: 12 additions & 12 deletions test/testautomation_rwops.c
Expand Up @@ -647,22 +647,22 @@ rwops_testFileWriteReadEndian(void)

/* Write test data */
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);
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);
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);
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);
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);
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);

/* Test seek to start */
Expand All @@ -672,22 +672,22 @@ rwops_testFileWriteReadEndian(void)

/* Read test data */
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);
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);
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);
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);
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);
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);

/* Close handle */
Expand Down
2 changes: 1 addition & 1 deletion test/testautomation_syswm.c
Expand Up @@ -32,7 +32,7 @@ syswm_getWindowWMInfo(void *arg)

/* Make call */
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");

SDL_DestroyWindow(window);
Expand Down
18 changes: 9 additions & 9 deletions test/testautomation_video.c
Expand Up @@ -51,7 +51,7 @@ void _destroyVideoSuiteTestWindow(SDL_Window *window)
if (window != NULL) {
SDL_DestroyWindow(window);
window = NULL;
SDLTest_AssertPass("Call to SDL_DestroyWindow");
SDLTest_AssertPass("Call to SDL_DestroyWindow()");
}
}

Expand Down Expand Up @@ -342,7 +342,7 @@ video_getWindowFlags(void *arg)
window = _createVideoSuiteTestWindow(title);
if (window != NULL) {
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);
}

Expand All @@ -364,7 +364,7 @@ video_getNumDisplayModes(void *arg)

/* Get number of displays */
displayNum = SDL_GetNumVideoDisplays();
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");

/* Make call for each display */
for (i=0; i<displayNum; i++) {
Expand All @@ -388,7 +388,7 @@ video_getNumDisplayModesNegative(void *arg)

/* Get number of displays */
displayNum = SDL_GetNumVideoDisplays();
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");

/* Invalid boundary values */
displayIndex = SDLTest_RandomSint32BoundaryValue(0, displayNum, SDL_FALSE);
Expand Down Expand Up @@ -427,15 +427,15 @@ video_getClosestDisplayModeCurrentResolution(void *arg)

/* Get number of displays */
displayNum = SDL_GetNumVideoDisplays();
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");

/* Make calls for each display */
for (i=0; i<displayNum; i++) {
SDLTest_Log("Testing against display: %d", i);

/* Get first display mode to get a sane resolution; this should always work */
result = SDL_GetDisplayMode(i, 0, &current);
SDLTest_AssertPass("Call to SDL_GetDisplayMode");
SDLTest_AssertPass("Call to SDL_GetDisplayMode()");
SDLTest_AssertCheck(result == 0, "Verify return value, expected: 0, got: %d", result);
if (result != 0) {
return TEST_ABORTED;
Expand Down Expand Up @@ -481,7 +481,7 @@ video_getClosestDisplayModeRandomResolution(void *arg)

/* Get number of displays */
displayNum = SDL_GetNumVideoDisplays();
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays");
SDLTest_AssertPass("Call to SDL_GetNumVideoDisplays()");

/* Make calls for each display */
for (i=0; i<displayNum; i++) {
Expand Down Expand Up @@ -521,7 +521,7 @@ video_getWindowBrightness(void *arg)
window = _createVideoSuiteTestWindow(title);
if (window != NULL) {
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);
}

Expand Down Expand Up @@ -583,7 +583,7 @@ video_getWindowDisplayMode(void *arg)
window = _createVideoSuiteTestWindow(title);
if (window != NULL) {
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(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);
Expand Down

0 comments on commit 743ba2f

Please sign in to comment.