#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <float.h>
#include <ctype.h>
#include "SDL.h"
#include "SDL_test.h"
Go to the source code of this file.
◆ SDLTest_GenerateRunSeed()
char* SDLTest_GenerateRunSeed |
( |
const int |
length | ) |
|
◆ sdltest_generateRunSeed()
int sdltest_generateRunSeed |
( |
void * |
arg | ) |
|
◆ sdltest_getFuzzerInvocationCount()
int sdltest_getFuzzerInvocationCount |
( |
void * |
arg | ) |
|
Calls to SDLTest_GetFuzzerInvocationCount()
Definition at line 65 of file testautomation_sdltest.c.
68 int fuzzerCount1, fuzzerCount2;
72 SDLTest_AssertCheck(fuzzerCount1 >= 0,
"Verify returned value, expected: >=0, got: %d", fuzzerCount1);
79 SDLTest_AssertCheck(fuzzerCount2 > fuzzerCount1,
"Verify returned value, expected: >%d, got: %d", fuzzerCount1, fuzzerCount2);
References SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_GetFuzzerInvocationCount(), SDLTest_RandomUint8(), and TEST_COMPLETED.
◆ sdltest_randomAsciiString()
int sdltest_randomAsciiString |
( |
void * |
arg | ) |
|
Calls to SDLTest_RandomAsciiString.
Definition at line 1120 of file testautomation_sdltest.c.
1124 int nonAsciiCharacters;
1133 nonAsciiCharacters = 0;
1136 nonAsciiCharacters++;
1139 SDLTest_AssertCheck(nonAsciiCharacters == 0,
"Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters);
1140 if (nonAsciiCharacters) {
References i, NULL, SDL_free, SDL_strlen, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_LogError(), SDLTest_RandomAsciiString(), and TEST_COMPLETED.
◆ sdltest_randomAsciiStringOfSize()
int sdltest_randomAsciiStringOfSize |
( |
void * |
arg | ) |
|
Calls to SDLTest_RandomAsciiStringOfSize.
Definition at line 1207 of file testautomation_sdltest.c.
1209 const char* expectedError =
"Parameter 'size' is invalid";
1214 int nonAsciiCharacters;
1224 SDLTest_AssertCheck(
len == targetLen,
"Validate that result length; expected: len=%d, got: %d", (
int) targetLen, (
int)
len);
1225 nonAsciiCharacters = 0;
1228 nonAsciiCharacters++;
1231 SDLTest_AssertCheck(nonAsciiCharacters == 0,
"Validate that result does not contain non-ASCII characters, got: %d", nonAsciiCharacters);
1232 if (nonAsciiCharacters) {
1246 "SDL_GetError(): expected message '%s', was message: '%s'",
References i, NULL, SDL_ClearError, SDL_free, SDL_GetError, SDL_strcmp, SDL_strlen, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_LogError(), SDLTest_RandomAsciiStringOfSize(), SDLTest_RandomUint8(), and TEST_COMPLETED.
◆ sdltest_randomAsciiStringWithMaximumLength()
int sdltest_randomAsciiStringWithMaximumLength |
( |
void * |
arg | ) |
|
Calls to SDLTest_RandomAsciiStringWithMaximumLength.
Definition at line 1154 of file testautomation_sdltest.c.
1156 const char* expectedError =
"Parameter 'maxLength' is invalid";
1161 int nonAsciiCharacters;
1166 SDLTest_AssertPass(
"Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", targetLen);
1170 SDLTest_AssertCheck(
len >= 1 &&
len <= targetLen,
"Validate that result length; expected: len=[1,%d], got: %d", (
int) targetLen, (
int)
len);
1171 nonAsciiCharacters = 0;
1174 nonAsciiCharacters++;
1177 SDLTest_AssertCheck(nonAsciiCharacters == 0,
"Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters);
1178 if (nonAsciiCharacters) {
1187 SDLTest_AssertPass(
"Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", targetLen);
1192 "SDL_GetError(): expected message '%s', was message: '%s'",
References i, NULL, SDL_ClearError, SDL_free, SDL_GetError, SDL_strcmp, SDL_strlen, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_LogError(), SDLTest_RandomAsciiStringWithMaximumLength(), SDLTest_RandomUint8(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberSint16()
int sdltest_randomBoundaryNumberSint16 |
( |
void * |
arg | ) |
|
Definition at line 708 of file testautomation_sdltest.c.
710 const char *expectedError =
"That operation is not supported";
723 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
729 sresult == 10 || sresult == 11,
730 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
736 sresult == 10 || sresult == 11 || sresult == 12,
737 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
743 sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
744 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
750 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
751 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
757 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
758 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
764 sresult == 0 || sresult == 21,
765 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
772 "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
779 "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult);
789 "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MAX, sresult);
799 "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult);
803 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint16BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberSint32()
int sdltest_randomBoundaryNumberSint32 |
( |
void * |
arg | ) |
|
Definition at line 818 of file testautomation_sdltest.c.
820 const char *expectedError =
"That operation is not supported";
823 #if ((ULONG_MAX) == (UINT_MAX))
824 Sint32 long_min = LONG_MIN;
825 Sint32 long_max = LONG_MAX;
827 Sint32 long_min = INT_MIN;
840 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
846 sresult == 10 || sresult == 11,
847 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
853 sresult == 10 || sresult == 11 || sresult == 12,
854 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
860 sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
861 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
867 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
868 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
874 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
875 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
881 sresult == 0 || sresult == 21,
882 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
889 "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
896 "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
906 "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_max, sresult);
916 "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
920 "SDL_GetError(): expected message '%s', was message: '%s'",
References INT_MAX, NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint32BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberSint64()
int sdltest_randomBoundaryNumberSint64 |
( |
void * |
arg | ) |
|
Definition at line 935 of file testautomation_sdltest.c.
937 const char *expectedError =
"That operation is not supported";
950 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
956 sresult == 10 || sresult == 11,
957 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
963 sresult == 10 || sresult == 11 || sresult == 12,
964 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
970 sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
971 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
977 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
978 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
984 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
985 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
991 sresult == 0 || sresult == 21,
992 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
999 "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
1005 sresult == INT64_MIN,
1006 "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, INT64_MIN, sresult);
1015 sresult == INT64_MAX,
1016 "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, INT64_MAX, sresult);
1025 sresult == INT64_MIN,
1026 "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, INT64_MIN, sresult);
1030 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint64BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberSint8()
int sdltest_randomBoundaryNumberSint8 |
( |
void * |
arg | ) |
|
Definition at line 598 of file testautomation_sdltest.c.
600 const char *expectedError =
"That operation is not supported";
613 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
619 sresult == 10 || sresult == 11,
620 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
626 sresult == 10 || sresult == 11 || sresult == 12,
627 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
633 sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
634 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
640 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
641 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
647 sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
648 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
654 sresult == 0 || sresult == 21,
655 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
662 "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
668 sresult == SCHAR_MIN,
669 "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult);
678 sresult == SCHAR_MAX,
679 "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MAX, sresult);
688 sresult == SCHAR_MIN,
689 "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult);
693 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint8BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberUint16()
int sdltest_randomBoundaryNumberUint16 |
( |
void * |
arg | ) |
|
Definition at line 268 of file testautomation_sdltest.c.
270 const char *expectedError =
"That operation is not supported";
283 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
289 uresult == 10 || uresult == 11,
290 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
296 uresult == 10 || uresult == 11 || uresult == 12,
297 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
303 uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
304 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
310 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
311 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
317 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
318 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
324 uresult == 0 || uresult == 21,
325 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
332 "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
339 "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
349 "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %"SDL_PRIs64, uresult);
359 "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
363 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint16BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberUint32()
int sdltest_randomBoundaryNumberUint32 |
( |
void * |
arg | ) |
|
Definition at line 378 of file testautomation_sdltest.c.
380 const char *expectedError =
"That operation is not supported";
393 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
399 uresult == 10 || uresult == 11,
400 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
406 uresult == 10 || uresult == 11 || uresult == 12,
407 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
413 uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
414 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
420 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
421 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
427 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
428 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
434 uresult == 0 || uresult == 21,
435 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
442 "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
449 "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
458 uresult == 0xffffffff,
459 "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %"SDL_PRIs64, uresult);
469 "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
473 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint32BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberUint64()
int sdltest_randomBoundaryNumberUint64 |
( |
void * |
arg | ) |
|
Definition at line 488 of file testautomation_sdltest.c.
490 const char *expectedError =
"That operation is not supported";
503 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
509 uresult == 10 || uresult == 11,
510 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
516 uresult == 10 || uresult == 11 || uresult == 12,
517 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
523 uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
524 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
530 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
531 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
537 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
538 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
544 uresult == 0 || uresult == 21,
545 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
552 "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
559 "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
568 uresult == (
Uint64)0xffffffffffffffffULL,
569 "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %"SDL_PRIs64, uresult);
579 "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
583 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint64BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomBoundaryNumberUint8()
int sdltest_randomBoundaryNumberUint8 |
( |
void * |
arg | ) |
|
Definition at line 158 of file testautomation_sdltest.c.
160 const char *expectedError =
"That operation is not supported";
173 "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
179 uresult == 10 || uresult == 11,
180 "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
186 uresult == 10 || uresult == 11 || uresult == 12,
187 "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
193 uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
194 "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
200 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
201 "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
207 uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
208 "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
214 uresult == 0 || uresult == 21,
215 "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
222 "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
229 "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
239 "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %"SDL_PRIs64, uresult);
249 "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
253 "SDL_GetError(): expected message '%s', was message: '%s'",
References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint8BoundaryValue(), and TEST_COMPLETED.
◆ sdltest_randomIntegerInRange()
int sdltest_randomIntegerInRange |
( |
void * |
arg | ) |
|
◆ sdltest_randomNumber()
int sdltest_randomNumber |
( |
void * |
arg | ) |
|
Calls to random number generators.
Definition at line 89 of file testautomation_sdltest.c.
109 umax = (1 << 16) - 1;
120 umax = ((
Uint64)1 << 32) - 1;
125 min = 0 - ((
Sint64)1 << 31);
126 max = ((
Sint64)1 << 31) - 1;
138 SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0,
"Verify result value, expected: [0.0,1.0[, got: %e", dresult);
142 SDLTest_AssertCheck(dresult >= (
double)(-FLT_MAX) && dresult <= (
double)FLT_MAX,
"Verify result value, expected: [%e,%e], got: %e", (
double)(-FLT_MAX), (
double)FLT_MAX, dresult);
146 SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0,
"Verify result value, expected: [0.0,1.0[, got: %e", dresult);
References SDL_PRIs64, SDL_PRIu64, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomDouble(), SDLTest_RandomFloat(), SDLTest_RandomSint16(), SDLTest_RandomSint32(), SDLTest_RandomSint64(), SDLTest_RandomSint8(), SDLTest_RandomUint16(), SDLTest_RandomUint32(), SDLTest_RandomUint64(), SDLTest_RandomUint8(), SDLTest_RandomUnitDouble(), SDLTest_RandomUnitFloat(), and TEST_COMPLETED.
◆ sdltestTest1
◆ sdltestTest10
◆ sdltestTest11
◆ sdltestTest12
◆ sdltestTest13
◆ sdltestTest14
◆ sdltestTest15
◆ sdltestTest2
◆ sdltestTest3
◆ sdltestTest4
◆ sdltestTest5
◆ sdltestTest6
◆ sdltestTest7
◆ sdltestTest8
◆ sdltestTest9
◆ sdltestTests
◆ sdltestTestSuite
static const SDLTest_TestCaseReference sdltestTest3
static const SDLTest_TestCaseReference * sdltestTests[]
int sdltest_randomAsciiString(void *arg)
Calls to SDLTest_RandomAsciiString.
int sdltest_randomBoundaryNumberUint8(void *arg)
double SDLTest_RandomDouble(void)
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain)
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
Uint32 SDLTest_RandomUint32(void)
static const SDLTest_TestCaseReference sdltestTest9
int sdltest_randomBoundaryNumberUint16(void *arg)
int sdltest_randomBoundaryNumberUint64(void *arg)
Uint64 SDLTest_RandomUint64(void)
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
int sdltest_randomBoundaryNumberUint32(void *arg)
static const SDLTest_TestCaseReference sdltestTest1
static const SDLTest_TestCaseReference sdltestTest12
int sdltest_randomBoundaryNumberSint32(void *arg)
int sdltest_randomAsciiStringOfSize(void *arg)
Calls to SDLTest_RandomAsciiStringOfSize.
int sdltest_generateRunSeed(void *arg)
Calls to SDLTest_GenerateRunSeed()
Sint16 SDLTest_RandomSint16(void)
GLuint GLsizei GLsizei * length
static const SDLTest_TestCaseReference sdltestTest5
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
Uint8 SDLTest_RandomUint8(void)
char * SDLTest_RandomAsciiStringOfSize(int size)
static const SDLTest_TestCaseReference sdltestTest6
static const SDLTest_TestCaseReference sdltestTest7
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain)
int(* SDLTest_TestCaseFp)(void *arg)
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
int sdltest_getFuzzerInvocationCount(void *arg)
Calls to SDLTest_GetFuzzerInvocationCount()
float SDLTest_RandomFloat(void)
static const SDLTest_TestCaseReference sdltestTest13
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
int sdltest_randomIntegerInRange(void *arg)
Calls to SDLTest_RandomIntegerInRange.
static const SDLTest_TestCaseReference sdltestTest15
static const SDLTest_TestCaseReference sdltestTest2
Sint64 SDLTest_RandomSint64(void)
double SDLTest_RandomUnitDouble(void)
char * SDLTest_RandomAsciiString(void)
static const SDLTest_TestCaseReference sdltestTest8
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int int return Display Window Cursor return Display Window return Display Drawable GC int int unsigned int unsigned int return Display Drawable GC int int _Xconst char int return Display Drawable GC int int unsigned int unsigned int return Display return Display Cursor return Display GC return XModifierKeymap return char Display Window int return Display return Display int int int return Display long XVisualInfo int return Display Window Atom long long Bool Atom Atom int unsigned long unsigned long unsigned char * l)
void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext)
Initialize random number generator based on current system time.
int sdltest_randomAsciiStringWithMaximumLength(void *arg)
Calls to SDLTest_RandomAsciiStringWithMaximumLength.
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and the ERROR priority.
Sint32 SDLTest_RandomSint32(void)
static const SDLTest_TestCaseReference sdltestTest11
int sdltest_randomBoundaryNumberSint16(void *arg)
char * SDLTest_GenerateRunSeed(const int length)
Generates a random run seed string for the harness. The generated seed will contain alphanumeric char...
static const SDLTest_TestCaseReference sdltestTest14
static const SDLTest_TestCaseReference sdltestTest4
char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
float SDLTest_RandomUnitFloat(void)
Uint16 SDLTest_RandomUint16(void)
int sdltest_randomNumber(void *arg)
Calls to random number generators.
Sint8 SDLTest_RandomSint8(void)
int sdltest_randomBoundaryNumberSint8(void *arg)
int SDLTest_GetFuzzerInvocationCount(void)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext)
Initialize random number generator based on current system time.
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
int sdltest_randomBoundaryNumberSint64(void *arg)
static const SDLTest_TestCaseReference sdltestTest10
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)