|
|
|
@ -93,35 +93,35 @@ sdltest_randomNumber(void *arg)
|
|
|
|
|
result = (Sint64)SDLTest_RandomUint8();
|
|
|
|
|
umax = (1 << 8) - 1;
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8");
|
|
|
|
|
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result);
|
|
|
|
|
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result);
|
|
|
|
|
|
|
|
|
|
result = (Sint64)SDLTest_RandomSint8();
|
|
|
|
|
min = 0 - (1 << 7);
|
|
|
|
|
max = (1 << 7) - 1;
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8");
|
|
|
|
|
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result);
|
|
|
|
|
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result);
|
|
|
|
|
|
|
|
|
|
result = (Sint64)SDLTest_RandomUint16();
|
|
|
|
|
umax = (1 << 16) - 1;
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16");
|
|
|
|
|
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result);
|
|
|
|
|
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result);
|
|
|
|
|
|
|
|
|
|
result = (Sint64)SDLTest_RandomSint16();
|
|
|
|
|
min = 0 - (1 << 15);
|
|
|
|
|
max = (1 << 15) - 1;
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16");
|
|
|
|
|
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result);
|
|
|
|
|
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result);
|
|
|
|
|
|
|
|
|
|
result = (Sint64)SDLTest_RandomUint32();
|
|
|
|
|
umax = ((Uint64)1 << 32) - 1;
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32");
|
|
|
|
|
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%llu], got: %lld", umax, result);
|
|
|
|
|
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result);
|
|
|
|
|
|
|
|
|
|
result = (Sint64)SDLTest_RandomSint32();
|
|
|
|
|
min = 0 - ((Sint64)1 << 31);
|
|
|
|
|
max = ((Sint64)1 << 31) - 1;
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32");
|
|
|
|
|
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%lld,%lld], got: %lld", min, max, result);
|
|
|
|
|
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result);
|
|
|
|
|
|
|
|
|
|
uresult = SDLTest_RandomUint64();
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64");
|
|
|
|
@ -166,63 +166,63 @@ sdltest_randomBoundaryNumberUint8(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0 || uresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 100,
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -232,7 +232,7 @@ sdltest_randomBoundaryNumberUint8(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0xff,
|
|
|
|
|
"Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -242,7 +242,7 @@ sdltest_randomBoundaryNumberUint8(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -276,63 +276,63 @@ sdltest_randomBoundaryNumberUint16(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0 || uresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 100,
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -342,7 +342,7 @@ sdltest_randomBoundaryNumberUint16(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0xffff,
|
|
|
|
|
"Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -352,7 +352,7 @@ sdltest_randomBoundaryNumberUint16(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -386,63 +386,63 @@ sdltest_randomBoundaryNumberUint32(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0 || uresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 100,
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -452,7 +452,7 @@ sdltest_randomBoundaryNumberUint32(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0xffffffff,
|
|
|
|
|
"Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -462,7 +462,7 @@ sdltest_randomBoundaryNumberUint32(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -496,63 +496,63 @@ sdltest_randomBoundaryNumberUint64(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0 || uresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 100,
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
|
|
|
|
|
/* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */
|
|
|
|
|
uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, (Uint64)0xffffffffffffffffULL, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -562,7 +562,7 @@ sdltest_randomBoundaryNumberUint64(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == (Uint64)0xffffffffffffffffULL,
|
|
|
|
|
"Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -572,7 +572,7 @@ sdltest_randomBoundaryNumberUint64(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
uresult == 0,
|
|
|
|
|
"Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %lld", uresult);
|
|
|
|
|
"Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -606,63 +606,63 @@ sdltest_randomBoundaryNumberSint8(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 0 || sresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 100,
|
|
|
|
|
"Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == SCHAR_MIN,
|
|
|
|
|
"Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %lld", SCHAR_MIN, sresult);
|
|
|
|
|
"Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -672,7 +672,7 @@ sdltest_randomBoundaryNumberSint8(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == SCHAR_MAX,
|
|
|
|
|
"Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %lld", SCHAR_MAX, sresult);
|
|
|
|
|
"Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MAX, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -682,7 +682,7 @@ sdltest_randomBoundaryNumberSint8(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == SCHAR_MIN,
|
|
|
|
|
"Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %lld", SCHAR_MIN, sresult);
|
|
|
|
|
"Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -716,63 +716,63 @@ sdltest_randomBoundaryNumberSint16(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 0 || sresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 100,
|
|
|
|
|
"Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == SHRT_MIN,
|
|
|
|
|
"Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %lld", SHRT_MIN, sresult);
|
|
|
|
|
"Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -782,7 +782,7 @@ sdltest_randomBoundaryNumberSint16(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == SHRT_MAX,
|
|
|
|
|
"Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %lld", SHRT_MAX, sresult);
|
|
|
|
|
"Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MAX, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -792,7 +792,7 @@ sdltest_randomBoundaryNumberSint16(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == SHRT_MIN,
|
|
|
|
|
"Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %lld", SHRT_MIN, sresult);
|
|
|
|
|
"Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -833,63 +833,63 @@ sdltest_randomBoundaryNumberSint32(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 0 || sresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 100,
|
|
|
|
|
"Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == long_min,
|
|
|
|
|
"Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult);
|
|
|
|
|
"Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -899,7 +899,7 @@ sdltest_randomBoundaryNumberSint32(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == long_max,
|
|
|
|
|
"Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %lld", long_max, sresult);
|
|
|
|
|
"Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_max, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -909,7 +909,7 @@ sdltest_randomBoundaryNumberSint32(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == long_min,
|
|
|
|
|
"Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %lld", long_min, sresult);
|
|
|
|
|
"Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
@ -943,63 +943,63 @@ sdltest_randomBoundaryNumberSint64(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10,
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11,
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12,
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 0 || sresult == 21,
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, 99, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == 100,
|
|
|
|
|
"Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %lld", sresult);
|
|
|
|
|
"Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
|
|
|
|
|
|
|
|
|
|
/* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */
|
|
|
|
|
sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE);
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == LLONG_MIN,
|
|
|
|
|
"Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %lld, got: %lld", LLONG_MIN, sresult);
|
|
|
|
|
"Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -1009,7 +1009,7 @@ sdltest_randomBoundaryNumberSint64(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == LLONG_MAX,
|
|
|
|
|
"Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %lld, got: %lld", LLONG_MAX, sresult);
|
|
|
|
|
"Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MAX, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
|
|
|
|
@ -1019,7 +1019,7 @@ sdltest_randomBoundaryNumberSint64(void *arg)
|
|
|
|
|
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
|
|
|
|
|
SDLTest_AssertCheck(
|
|
|
|
|
sresult == LLONG_MIN,
|
|
|
|
|
"Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %lld, got: %lld", LLONG_MIN, sresult);
|
|
|
|
|
"Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult);
|
|
|
|
|
lastError = (char *)SDL_GetError();
|
|
|
|
|
SDLTest_AssertPass("SDL_GetError()");
|
|
|
|
|
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
|
|
|
|
|