SDL  2.0
testautomation_sdltest.c File Reference
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include <float.h>
#include <ctype.h>
#include "SDL.h"
#include "SDL_test.h"
+ Include dependency graph for testautomation_sdltest.c:

Go to the source code of this file.

Functions

char * SDLTest_GenerateRunSeed (const int length)
 
int sdltest_generateRunSeed (void *arg)
 Calls to SDLTest_GenerateRunSeed() More...
 
int sdltest_getFuzzerInvocationCount (void *arg)
 Calls to SDLTest_GetFuzzerInvocationCount() More...
 
int sdltest_randomNumber (void *arg)
 Calls to random number generators. More...
 
int sdltest_randomBoundaryNumberUint8 (void *arg)
 
int sdltest_randomBoundaryNumberUint16 (void *arg)
 
int sdltest_randomBoundaryNumberUint32 (void *arg)
 
int sdltest_randomBoundaryNumberUint64 (void *arg)
 
int sdltest_randomBoundaryNumberSint8 (void *arg)
 
int sdltest_randomBoundaryNumberSint16 (void *arg)
 
int sdltest_randomBoundaryNumberSint32 (void *arg)
 
int sdltest_randomBoundaryNumberSint64 (void *arg)
 
int sdltest_randomIntegerInRange (void *arg)
 Calls to SDLTest_RandomIntegerInRange. More...
 
int sdltest_randomAsciiString (void *arg)
 Calls to SDLTest_RandomAsciiString. More...
 
int sdltest_randomAsciiStringWithMaximumLength (void *arg)
 Calls to SDLTest_RandomAsciiStringWithMaximumLength. More...
 
int sdltest_randomAsciiStringOfSize (void *arg)
 Calls to SDLTest_RandomAsciiStringOfSize. More...
 

Variables

static const SDLTest_TestCaseReference sdltestTest1
 
static const SDLTest_TestCaseReference sdltestTest2
 
static const SDLTest_TestCaseReference sdltestTest3
 
static const SDLTest_TestCaseReference sdltestTest4
 
static const SDLTest_TestCaseReference sdltestTest5
 
static const SDLTest_TestCaseReference sdltestTest6
 
static const SDLTest_TestCaseReference sdltestTest7
 
static const SDLTest_TestCaseReference sdltestTest8
 
static const SDLTest_TestCaseReference sdltestTest9
 
static const SDLTest_TestCaseReference sdltestTest10
 
static const SDLTest_TestCaseReference sdltestTest11
 
static const SDLTest_TestCaseReference sdltestTest12
 
static const SDLTest_TestCaseReference sdltestTest13
 
static const SDLTest_TestCaseReference sdltestTest14
 
static const SDLTest_TestCaseReference sdltestTest15
 
static const SDLTest_TestCaseReferencesdltestTests []
 
SDLTest_TestSuiteReference sdltestTestSuite
 

Function Documentation

◆ SDLTest_GenerateRunSeed()

char* SDLTest_GenerateRunSeed ( const int  length)

SDL_test test suite

Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).

Note: The returned string needs to be deallocated by the caller.

Parameters
lengthThe length of the seed string to generate
Returns
The generated seed string

Definition at line 54 of file SDL_test_harness.c.

References NULL, SDL_ENOMEM, SDL_Error, SDL_malloc, SDLTest_LogError(), SDLTest_Random(), and SDLTest_RandomInitTime().

Referenced by sdltest_generateRunSeed(), and SDLTest_RunSuites().

55 {
56  char *seed = NULL;
57  SDLTest_RandomContext randomContext;
58  int counter;
59 
60  /* Sanity check input */
61  if (length <= 0) {
62  SDLTest_LogError("The length of the harness seed must be >0.");
63  return NULL;
64  }
65 
66  /* Allocate output buffer */
67  seed = (char *)SDL_malloc((length + 1) * sizeof(char));
68  if (seed == NULL) {
69  SDLTest_LogError("SDL_malloc for run seed output buffer failed.");
71  return NULL;
72  }
73 
74  /* Generate a random string of alphanumeric characters */
75  SDLTest_RandomInitTime(&randomContext);
76  for (counter = 0; counter < length; counter++) {
77  unsigned int number = SDLTest_Random(&randomContext);
78  char ch = (char) (number % (91 - 48)) + 48;
79  if (ch >= 58 && ch <= 64) {
80  ch = 65;
81  }
82  seed[counter] = ch;
83  }
84  seed[length] = '\0';
85 
86  return seed;
87 }
#define SDL_Error
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.
Definition: SDL_test_log.c:88
void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext)
Initialize random number generator based on current system time.
unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext)
Initialize random number generator based on current system time.
#define NULL
Definition: begin_code.h:143
GLuint counter
#define SDL_malloc
GLuint GLsizei GLsizei * length

◆ sdltest_generateRunSeed()

int sdltest_generateRunSeed ( void arg)

Calls to SDLTest_GenerateRunSeed()

Definition at line 31 of file testautomation_sdltest.c.

References i, NULL, SDL_free(), SDL_strlen, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_GenerateRunSeed(), and TEST_COMPLETED.

32 {
33  char* result;
34  int i, l;
35 
36  for (i = 1; i <= 10; i += 3) {
37  result = SDLTest_GenerateRunSeed((const int)i);
38  SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()");
39  SDLTest_AssertCheck(result != NULL, "Verify returned value is not NULL");
40  if (result != NULL) {
41  l = SDL_strlen(result);
42  SDLTest_AssertCheck(l == i, "Verify length of returned value is %d, got: %d", i, l);
43  SDL_free(result);
44  }
45  }
46 
47  /* Negative cases */
48  for (i = -2; i <= 0; i++) {
49  result = SDLTest_GenerateRunSeed((const int)i);
50  SDLTest_AssertPass("Call to SDLTest_GenerateRunSeed()");
51  SDLTest_AssertCheck(result == NULL, "Verify returned value is not NULL");
52  }
53 
54  return TEST_COMPLETED;
55 }
GLuint64EXT * result
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_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...
void SDL_free(void *mem)
#define TEST_COMPLETED
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)
Definition: SDL_x11sym.h:50
#define NULL
Definition: begin_code.h:143
#define SDL_strlen
char * SDLTest_GenerateRunSeed(const int length)

◆ sdltest_getFuzzerInvocationCount()

int sdltest_getFuzzerInvocationCount ( void arg)

Calls to SDLTest_GetFuzzerInvocationCount()

Definition at line 61 of file testautomation_sdltest.c.

References SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_GetFuzzerInvocationCount(), SDLTest_RandomUint8(), and TEST_COMPLETED.

62 {
63  Uint8 result;
64  int fuzzerCount1, fuzzerCount2;
65 
66  fuzzerCount1 = SDLTest_GetFuzzerInvocationCount();
67  SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()");
68  SDLTest_AssertCheck(fuzzerCount1 >= 0, "Verify returned value, expected: >=0, got: %d", fuzzerCount1);
69 
70  result = SDLTest_RandomUint8();
71  SDLTest_AssertPass("Call to SDLTest_RandomUint8(), returned %d", result);
72 
73  fuzzerCount2 = SDLTest_GetFuzzerInvocationCount();
74  SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()");
75  SDLTest_AssertCheck(fuzzerCount2 > fuzzerCount1, "Verify returned value, expected: >%d, got: %d", fuzzerCount1, fuzzerCount2);
76 
77  return TEST_COMPLETED;
78 }
GLuint64EXT * result
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.
Uint8 SDLTest_RandomUint8()
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...
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:143
#define TEST_COMPLETED
int SDLTest_GetFuzzerInvocationCount()

◆ sdltest_randomAsciiString()

int sdltest_randomAsciiString ( void arg)

Calls to SDLTest_RandomAsciiString.

Definition at line 1116 of file testautomation_sdltest.c.

References i, NULL, SDL_free(), SDL_strlen, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_LogError(), SDLTest_RandomAsciiString(), and TEST_COMPLETED.

1117 {
1118  char* result;
1119  int len;
1120  int nonAsciiCharacters;
1121  int i;
1122 
1123  result = SDLTest_RandomAsciiString();
1124  SDLTest_AssertPass("Call to SDLTest_RandomAsciiString()");
1125  SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL");
1126  if (result != NULL) {
1127  len = SDL_strlen(result);
1128  SDLTest_AssertCheck(len >= 0 && len <= 255, "Validate that result length; expected: len=[1,255], got: %d", len);
1129  nonAsciiCharacters = 0;
1130  for (i=0; i<len; i++) {
1131  if (iscntrl(result[i])) {
1132  nonAsciiCharacters++;
1133  }
1134  }
1135  SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters);
1136  if (nonAsciiCharacters) {
1137  SDLTest_LogError("Invalid result from generator: '%s'", result);
1138  }
1139  SDL_free(result);
1140  }
1141 
1142  return TEST_COMPLETED;
1143 }
GLuint64EXT * result
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.
char * SDLTest_RandomAsciiString()
GLenum GLsizei len
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.
Definition: SDL_test_log.c:88
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...
void SDL_free(void *mem)
#define TEST_COMPLETED
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)
Definition: SDL_x11sym.h:50
#define NULL
Definition: begin_code.h:143
#define SDL_strlen

◆ sdltest_randomAsciiStringOfSize()

int sdltest_randomAsciiStringOfSize ( void arg)

Calls to SDLTest_RandomAsciiStringOfSize.

Definition at line 1203 of file testautomation_sdltest.c.

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.

1204 {
1205  const char* expectedError = "Parameter 'size' is invalid";
1206  char* lastError;
1207  char* result;
1208  int targetLen;
1209  int len;
1210  int nonAsciiCharacters;
1211  int i;
1212 
1213  /* Positive test */
1214  targetLen = 16 + SDLTest_RandomUint8();
1215  result = SDLTest_RandomAsciiStringOfSize(targetLen);
1216  SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", targetLen);
1217  SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL");
1218  if (result != NULL) {
1219  len = SDL_strlen(result);
1220  SDLTest_AssertCheck(len == targetLen, "Validate that result length; expected: len=%d, got: %d", targetLen, len);
1221  nonAsciiCharacters = 0;
1222  for (i=0; i<len; i++) {
1223  if (iscntrl(result[i])) {
1224  nonAsciiCharacters++;
1225  }
1226  }
1227  SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-ASCII characters, got: %d", nonAsciiCharacters);
1228  if (nonAsciiCharacters) {
1229  SDLTest_LogError("Invalid result from generator: '%s'", result);
1230  }
1231  SDL_free(result);
1232  }
1233 
1234  /* Negative test */
1235  targetLen = 0;
1236  result = SDLTest_RandomAsciiStringOfSize(targetLen);
1237  SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", targetLen);
1238  SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
1239  lastError = (char *)SDL_GetError();
1240  SDLTest_AssertPass("SDL_GetError()");
1241  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
1242  "SDL_GetError(): expected message '%s', was message: '%s'",
1243  expectedError,
1244  lastError);
1245 
1246  /* Clear error messages */
1247  SDL_ClearError();
1248  SDLTest_AssertPass("SDL_ClearError()");
1249 
1250  return TEST_COMPLETED;
1251 }
#define SDL_ClearError
#define SDL_GetError
GLuint64EXT * result
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.
GLenum GLsizei len
Uint8 SDLTest_RandomUint8()
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.
Definition: SDL_test_log.c:88
char * SDLTest_RandomAsciiStringOfSize(int size)
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...
void SDL_free(void *mem)
#define TEST_COMPLETED
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)
Definition: SDL_x11sym.h:50
#define NULL
Definition: begin_code.h:143
#define SDL_strlen
#define SDL_strcmp

◆ sdltest_randomAsciiStringWithMaximumLength()

int sdltest_randomAsciiStringWithMaximumLength ( void arg)

Calls to SDLTest_RandomAsciiStringWithMaximumLength.

Definition at line 1150 of file testautomation_sdltest.c.

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.

1151 {
1152  const char* expectedError = "Parameter 'maxLength' is invalid";
1153  char* lastError;
1154  char* result;
1155  int targetLen;
1156  int len;
1157  int nonAsciiCharacters;
1158  int i;
1159 
1160  targetLen = 16 + SDLTest_RandomUint8();
1161  result = SDLTest_RandomAsciiStringWithMaximumLength(targetLen);
1162  SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", targetLen);
1163  SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL");
1164  if (result != NULL) {
1165  len = SDL_strlen(result);
1166  SDLTest_AssertCheck(len >= 0 && len <= targetLen, "Validate that result length; expected: len=[1,%d], got: %d", targetLen, len);
1167  nonAsciiCharacters = 0;
1168  for (i=0; i<len; i++) {
1169  if (iscntrl(result[i])) {
1170  nonAsciiCharacters++;
1171  }
1172  }
1173  SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters);
1174  if (nonAsciiCharacters) {
1175  SDLTest_LogError("Invalid result from generator: '%s'", result);
1176  }
1177  SDL_free(result);
1178  }
1179 
1180  /* Negative test */
1181  targetLen = 0;
1182  result = SDLTest_RandomAsciiStringWithMaximumLength(targetLen);
1183  SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", targetLen);
1184  SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
1185  lastError = (char *)SDL_GetError();
1186  SDLTest_AssertPass("SDL_GetError()");
1187  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
1188  "SDL_GetError(): expected message '%s', was message: '%s'",
1189  expectedError,
1190  lastError);
1191 
1192  /* Clear error messages */
1193  SDL_ClearError();
1194  SDLTest_AssertPass("SDL_ClearError()");
1195 
1196  return TEST_COMPLETED;
1197 }
#define SDL_ClearError
#define SDL_GetError
GLuint64EXT * result
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.
GLenum GLsizei len
Uint8 SDLTest_RandomUint8()
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.
Definition: SDL_test_log.c:88
char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
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...
void SDL_free(void *mem)
#define TEST_COMPLETED
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)
Definition: SDL_x11sym.h:50
#define NULL
Definition: begin_code.h:143
#define SDL_strlen
#define SDL_strcmp

◆ sdltest_randomBoundaryNumberSint16()

int sdltest_randomBoundaryNumberSint16 ( void arg)

Definition at line 704 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint16BoundaryValue(), and TEST_COMPLETED.

705 {
706  const char *expectedError = "That operation is not supported";
707  char *lastError;
708  Sint64 sresult;
709 
710  /* Clean error messages */
711  SDL_ClearError();
712  SDLTest_AssertPass("SDL_ClearError()");
713 
714  /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
716  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
718  sresult == 10,
719  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
720 
721  /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
723  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
725  sresult == 10 || sresult == 11,
726  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
727 
728  /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
730  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
732  sresult == 10 || sresult == 11 || sresult == 12,
733  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
734 
735  /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
737  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
739  sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
740  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
741 
742  /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
744  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
746  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
747  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
748 
749  /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
751  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
753  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
754  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
755 
756  /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
758  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
760  sresult == 0 || sresult == 21,
761  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
762 
763  /* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */
764  sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE);
765  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
767  sresult == 100,
768  "Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
769 
770  /* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */
771  sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE);
772  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
774  sresult == SHRT_MIN,
775  "Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult);
776  lastError = (char *)SDL_GetError();
777  SDLTest_AssertPass("SDL_GetError()");
778  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
779 
780  /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE) returns SHRT_MAX (no error) */
781  sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE);
782  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
784  sresult == SHRT_MAX,
785  "Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MAX, sresult);
786  lastError = (char *)SDL_GetError();
787  SDLTest_AssertPass("SDL_GetError()");
788  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
789 
790  /* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE) returns 0 (sets error) */
791  sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE);
792  SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue");
794  sresult == SHRT_MIN,
795  "Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SHRT_MIN, sresult);
796  lastError = (char *)SDL_GetError();
797  SDLTest_AssertPass("SDL_GetError()");
798  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
799  "SDL_GetError(): expected message '%s', was message: '%s'",
800  expectedError,
801  lastError);
802 
803  /* Clear error messages */
804  SDL_ClearError();
805  SDLTest_AssertPass("SDL_ClearError()");
806 
807  return TEST_COMPLETED;
808 }
#define SDL_ClearError
#define SDL_GetError
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.
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
#define SDL_strcmp
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:166

◆ sdltest_randomBoundaryNumberSint32()

int sdltest_randomBoundaryNumberSint32 ( void arg)

Definition at line 814 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint32BoundaryValue(), and TEST_COMPLETED.

815 {
816  const char *expectedError = "That operation is not supported";
817  char *lastError;
818  Sint64 sresult;
819 #if ((ULONG_MAX) == (UINT_MAX))
820  Sint32 long_min = LONG_MIN;
821  Sint32 long_max = LONG_MAX;
822 #else
823  Sint32 long_min = INT_MIN;
824  Sint32 long_max = INT_MAX;
825 #endif
826 
827  /* Clean error messages */
828  SDL_ClearError();
829  SDLTest_AssertPass("SDL_ClearError()");
830 
831  /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
833  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
835  sresult == 10,
836  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
837 
838  /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
840  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
842  sresult == 10 || sresult == 11,
843  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
844 
845  /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
847  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
849  sresult == 10 || sresult == 11 || sresult == 12,
850  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
851 
852  /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
854  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
856  sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
857  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
858 
859  /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
861  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
863  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
864  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
865 
866  /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
868  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
870  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
871  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
872 
873  /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
875  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
877  sresult == 0 || sresult == 21,
878  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
879 
880  /* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */
881  sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE);
882  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
884  sresult == 100,
885  "Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
886 
887  /* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */
888  sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE);
889  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
891  sresult == long_min,
892  "Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
893  lastError = (char *)SDL_GetError();
894  SDLTest_AssertPass("SDL_GetError()");
895  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
896 
897  /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */
898  sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE);
899  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
901  sresult == long_max,
902  "Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_max, sresult);
903  lastError = (char *)SDL_GetError();
904  SDLTest_AssertPass("SDL_GetError()");
905  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
906 
907  /* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */
908  sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE);
909  SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue");
911  sresult == long_min,
912  "Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, long_min, sresult);
913  lastError = (char *)SDL_GetError();
914  SDLTest_AssertPass("SDL_GetError()");
915  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
916  "SDL_GetError(): expected message '%s', was message: '%s'",
917  expectedError,
918  lastError);
919 
920  /* Clear error messages */
921  SDL_ClearError();
922  SDLTest_AssertPass("SDL_ClearError()");
923 
924  return TEST_COMPLETED;
925 }
#define SDL_ClearError
#define SDL_GetError
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.
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
int32_t Sint32
Definition: SDL_stdinc.h:157
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
#define SDL_strcmp
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:166

◆ sdltest_randomBoundaryNumberSint64()

int sdltest_randomBoundaryNumberSint64 ( void arg)

Definition at line 931 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint64BoundaryValue(), and TEST_COMPLETED.

932 {
933  const char *expectedError = "That operation is not supported";
934  char *lastError;
935  Sint64 sresult;
936 
937  /* Clean error messages */
938  SDL_ClearError();
939  SDLTest_AssertPass("SDL_ClearError()");
940 
941  /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
943  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
945  sresult == 10,
946  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
947 
948  /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
950  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
952  sresult == 10 || sresult == 11,
953  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
954 
955  /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
957  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
959  sresult == 10 || sresult == 11 || sresult == 12,
960  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
961 
962  /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
964  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
966  sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
967  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
968 
969  /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
971  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
973  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
974  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
975 
976  /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
978  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
980  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
981  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
982 
983  /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
985  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
987  sresult == 0 || sresult == 21,
988  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
989 
990  /* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */
991  sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, 99, SDL_FALSE);
992  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
994  sresult == 100,
995  "Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
996 
997  /* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */
998  sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE);
999  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
1001  sresult == LLONG_MIN,
1002  "Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult);
1003  lastError = (char *)SDL_GetError();
1004  SDLTest_AssertPass("SDL_GetError()");
1005  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
1006 
1007  /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE) returns LLONG_MAX (no error) */
1008  sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE);
1009  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
1011  sresult == LLONG_MAX,
1012  "Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MAX, sresult);
1013  lastError = (char *)SDL_GetError();
1014  SDLTest_AssertPass("SDL_GetError()");
1015  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
1016 
1017  /* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE) returns 0 (sets error) */
1018  sresult = (Sint64)SDLTest_RandomSint64BoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE);
1019  SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue");
1021  sresult == LLONG_MIN,
1022  "Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %"SDL_PRIs64", got: %"SDL_PRIs64, LLONG_MIN, sresult);
1023  lastError = (char *)SDL_GetError();
1024  SDLTest_AssertPass("SDL_GetError()");
1025  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
1026  "SDL_GetError(): expected message '%s', was message: '%s'",
1027  expectedError,
1028  lastError);
1029 
1030  /* Clear error messages */
1031  SDL_ClearError();
1032  SDLTest_AssertPass("SDL_ClearError()");
1033 
1034  return TEST_COMPLETED;
1035 }
#define SDL_ClearError
#define SDL_GetError
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.
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
#define SDL_strcmp
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:166

◆ sdltest_randomBoundaryNumberSint8()

int sdltest_randomBoundaryNumberSint8 ( void arg)

Definition at line 594 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomSint8BoundaryValue(), and TEST_COMPLETED.

595 {
596  const char *expectedError = "That operation is not supported";
597  char *lastError;
598  Sint64 sresult;
599 
600  /* Clean error messages */
601  SDL_ClearError();
602  SDLTest_AssertPass("SDL_ClearError()");
603 
604  /* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
606  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
608  sresult == 10,
609  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, sresult);
610 
611  /* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
613  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
615  sresult == 10 || sresult == 11,
616  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, sresult);
617 
618  /* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
620  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
622  sresult == 10 || sresult == 11 || sresult == 12,
623  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, sresult);
624 
625  /* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
627  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
629  sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13,
630  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, sresult);
631 
632  /* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
634  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
636  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
637  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
638 
639  /* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
641  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
643  sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20,
644  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, sresult);
645 
646  /* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
648  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
650  sresult == 0 || sresult == 21,
651  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, sresult);
652 
653  /* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */
654  sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE);
655  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
657  sresult == 100,
658  "Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, sresult);
659 
660  /* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */
661  sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE);
662  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
664  sresult == SCHAR_MIN,
665  "Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult);
666  lastError = (char *)SDL_GetError();
667  SDLTest_AssertPass("SDL_GetError()");
668  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
669 
670  /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE) returns SCHAR_MAX (no error) */
671  sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX -1, SDL_FALSE);
672  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
674  sresult == SCHAR_MAX,
675  "Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MAX, sresult);
676  lastError = (char *)SDL_GetError();
677  SDLTest_AssertPass("SDL_GetError()");
678  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
679 
680  /* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (sets error) */
681  sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE);
682  SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue");
684  sresult == SCHAR_MIN,
685  "Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %"SDL_PRIs64, SCHAR_MIN, sresult);
686  lastError = (char *)SDL_GetError();
687  SDLTest_AssertPass("SDL_GetError()");
688  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
689  "SDL_GetError(): expected message '%s', was message: '%s'",
690  expectedError,
691  lastError);
692 
693  /* Clear error messages */
694  SDL_ClearError();
695  SDLTest_AssertPass("SDL_ClearError()");
696 
697  return TEST_COMPLETED;
698 }
#define SDL_ClearError
#define SDL_GetError
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.
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain)
#define SDL_strcmp
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:166

◆ sdltest_randomBoundaryNumberUint16()

int sdltest_randomBoundaryNumberUint16 ( void arg)

Definition at line 264 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint16BoundaryValue(), and TEST_COMPLETED.

265 {
266  const char *expectedError = "That operation is not supported";
267  char *lastError;
268  Uint64 uresult;
269 
270  /* Clean error messages */
271  SDL_ClearError();
272  SDLTest_AssertPass("SDL_ClearError()");
273 
274  /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
276  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
278  uresult == 10,
279  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
280 
281  /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
283  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
285  uresult == 10 || uresult == 11,
286  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
287 
288  /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
290  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
292  uresult == 10 || uresult == 11 || uresult == 12,
293  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
294 
295  /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
297  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
299  uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
300  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
301 
302  /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
304  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
306  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
307  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
308 
309  /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
311  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
313  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
314  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
315 
316  /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
318  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
320  uresult == 0 || uresult == 21,
321  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
322 
323  /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
325  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
327  uresult == 100,
328  "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
329 
330  /* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */
331  uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE);
332  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
334  uresult == 0,
335  "Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
336  lastError = (char *)SDL_GetError();
337  SDLTest_AssertPass("SDL_GetError()");
338  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
339 
340  /* RandomUintXBoundaryValue(0, 0xfffe, SDL_FALSE) returns 0xffff (no error) */
341  uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, SDL_FALSE);
342  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
344  uresult == 0xffff,
345  "Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %"SDL_PRIs64, uresult);
346  lastError = (char *)SDL_GetError();
347  SDLTest_AssertPass("SDL_GetError()");
348  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
349 
350  /* RandomUintXBoundaryValue(0, 0xffff, SDL_FALSE) returns 0 (sets error) */
351  uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, SDL_FALSE);
352  SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue");
354  uresult == 0,
355  "Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
356  lastError = (char *)SDL_GetError();
357  SDLTest_AssertPass("SDL_GetError()");
358  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
359  "SDL_GetError(): expected message '%s', was message: '%s'",
360  expectedError,
361  lastError);
362 
363  /* Clear error messages */
364  SDL_ClearError();
365  SDLTest_AssertPass("SDL_ClearError()");
366 
367  return TEST_COMPLETED;
368 }
#define SDL_ClearError
#define SDL_GetError
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.
uint64_t Uint64
An unsigned 64-bit integer type.
Definition: SDL_stdinc.h:170
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
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...
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
#define SDL_strcmp

◆ sdltest_randomBoundaryNumberUint32()

int sdltest_randomBoundaryNumberUint32 ( void arg)

Definition at line 374 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint32BoundaryValue(), and TEST_COMPLETED.

375 {
376  const char *expectedError = "That operation is not supported";
377  char *lastError;
378  Uint64 uresult;
379 
380  /* Clean error messages */
381  SDL_ClearError();
382  SDLTest_AssertPass("SDL_ClearError()");
383 
384  /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
386  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
388  uresult == 10,
389  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
390 
391  /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
393  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
395  uresult == 10 || uresult == 11,
396  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
397 
398  /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
400  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
402  uresult == 10 || uresult == 11 || uresult == 12,
403  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
404 
405  /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
407  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
409  uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
410  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
411 
412  /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
414  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
416  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
417  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
418 
419  /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
421  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
423  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
424  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
425 
426  /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
428  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
430  uresult == 0 || uresult == 21,
431  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
432 
433  /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
435  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
437  uresult == 100,
438  "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
439 
440  /* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */
441  uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE);
442  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
444  uresult == 0,
445  "Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
446  lastError = (char *)SDL_GetError();
447  SDLTest_AssertPass("SDL_GetError()");
448  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
449 
450  /* RandomUintXBoundaryValue(0, 0xfffffffe, SDL_FALSE) returns 0xffffffff (no error) */
451  uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, SDL_FALSE);
452  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
454  uresult == 0xffffffff,
455  "Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %"SDL_PRIs64, uresult);
456  lastError = (char *)SDL_GetError();
457  SDLTest_AssertPass("SDL_GetError()");
458  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
459 
460  /* RandomUintXBoundaryValue(0, 0xffffffff, SDL_FALSE) returns 0 (sets error) */
461  uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, SDL_FALSE);
462  SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue");
464  uresult == 0,
465  "Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
466  lastError = (char *)SDL_GetError();
467  SDLTest_AssertPass("SDL_GetError()");
468  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
469  "SDL_GetError(): expected message '%s', was message: '%s'",
470  expectedError,
471  lastError);
472 
473  /* Clear error messages */
474  SDL_ClearError();
475  SDLTest_AssertPass("SDL_ClearError()");
476 
477  return TEST_COMPLETED;
478 }
#define SDL_ClearError
#define SDL_GetError
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.
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
uint64_t Uint64
An unsigned 64-bit integer type.
Definition: SDL_stdinc.h:170
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
#define SDL_strcmp

◆ sdltest_randomBoundaryNumberUint64()

int sdltest_randomBoundaryNumberUint64 ( void arg)

Definition at line 484 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint64BoundaryValue(), and TEST_COMPLETED.

485 {
486  const char *expectedError = "That operation is not supported";
487  char *lastError;
488  Uint64 uresult;
489 
490  /* Clean error messages */
491  SDL_ClearError();
492  SDLTest_AssertPass("SDL_ClearError()");
493 
494  /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
496  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
498  uresult == 10,
499  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
500 
501  /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
503  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
505  uresult == 10 || uresult == 11,
506  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
507 
508  /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
510  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
512  uresult == 10 || uresult == 11 || uresult == 12,
513  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
514 
515  /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
517  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
519  uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
520  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
521 
522  /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
524  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
526  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
527  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
528 
529  /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
531  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
533  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
534  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
535 
536  /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
538  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
540  uresult == 0 || uresult == 21,
541  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
542 
543  /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
545  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
547  uresult == 100,
548  "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
549 
550  /* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */
551  uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(1, (Uint64)0xffffffffffffffffULL, SDL_FALSE);
552  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
554  uresult == 0,
555  "Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
556  lastError = (char *)SDL_GetError();
557  SDLTest_AssertPass("SDL_GetError()");
558  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
559 
560  /* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, SDL_FALSE) returns 0xffffffffffffffff (no error) */
561  uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, (Uint64)0xfffffffffffffffeULL, SDL_FALSE);
562  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
564  uresult == (Uint64)0xffffffffffffffffULL,
565  "Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %"SDL_PRIs64, uresult);
566  lastError = (char *)SDL_GetError();
567  SDLTest_AssertPass("SDL_GetError()");
568  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
569 
570  /* RandomUintXBoundaryValue(0, 0xffffffffffffffff, SDL_FALSE) returns 0 (sets error) */
571  uresult = (Uint64)SDLTest_RandomUint64BoundaryValue(0, (Uint64)0xffffffffffffffffULL, SDL_FALSE);
572  SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue");
574  uresult == 0,
575  "Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
576  lastError = (char *)SDL_GetError();
577  SDLTest_AssertPass("SDL_GetError()");
578  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
579  "SDL_GetError(): expected message '%s', was message: '%s'",
580  expectedError,
581  lastError);
582 
583  /* Clear error messages */
584  SDL_ClearError();
585  SDLTest_AssertPass("SDL_ClearError()");
586 
587  return TEST_COMPLETED;
588 }
#define SDL_ClearError
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
#define SDL_GetError
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.
uint64_t Uint64
An unsigned 64-bit integer type.
Definition: SDL_stdinc.h:170
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
#define SDL_strcmp

◆ sdltest_randomBoundaryNumberUint8()

int sdltest_randomBoundaryNumberUint8 ( void arg)

Definition at line 154 of file testautomation_sdltest.c.

References NULL, SDL_ClearError, SDL_FALSE, SDL_GetError, SDL_PRIs64, SDL_strcmp, SDL_TRUE, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomUint8BoundaryValue(), and TEST_COMPLETED.

155 {
156  const char *expectedError = "That operation is not supported";
157  char *lastError;
158  Uint64 uresult;
159 
160  /* Clean error messages */
161  SDL_ClearError();
162  SDLTest_AssertPass("SDL_ClearError()");
163 
164  /* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */
166  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
168  uresult == 10,
169  "Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %"SDL_PRIs64, uresult);
170 
171  /* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */
173  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
175  uresult == 10 || uresult == 11,
176  "Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %"SDL_PRIs64, uresult);
177 
178  /* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */
180  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
182  uresult == 10 || uresult == 11 || uresult == 12,
183  "Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %"SDL_PRIs64, uresult);
184 
185  /* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */
187  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
189  uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13,
190  "Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %"SDL_PRIs64, uresult);
191 
192  /* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */
194  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
196  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
197  "Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
198 
199  /* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */
201  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
203  uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20,
204  "Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %"SDL_PRIs64, uresult);
205 
206  /* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */
208  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
210  uresult == 0 || uresult == 21,
211  "Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %"SDL_PRIs64, uresult);
212 
213  /* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */
215  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
217  uresult == 100,
218  "Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %"SDL_PRIs64, uresult);
219 
220  /* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */
222  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
224  uresult == 0,
225  "Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
226  lastError = (char *)SDL_GetError();
227  SDLTest_AssertPass("SDL_GetError()");
228  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
229 
230  /* RandomUintXBoundaryValue(0, 0xfe, SDL_FALSE) returns 0xff (no error) */
232  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
234  uresult == 0xff,
235  "Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %"SDL_PRIs64, uresult);
236  lastError = (char *)SDL_GetError();
237  SDLTest_AssertPass("SDL_GetError()");
238  SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set");
239 
240  /* RandomUintXBoundaryValue(0, 0xff, SDL_FALSE) returns 0 (sets error) */
242  SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue");
244  uresult == 0,
245  "Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %"SDL_PRIs64, uresult);
246  lastError = (char *)SDL_GetError();
247  SDLTest_AssertPass("SDL_GetError()");
248  SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0,
249  "SDL_GetError(): expected message '%s', was message: '%s'",
250  expectedError,
251  lastError);
252 
253  /* Clear error messages */
254  SDL_ClearError();
255  SDLTest_AssertPass("SDL_ClearError()");
256 
257  return TEST_COMPLETED;
258 }
#define SDL_ClearError
#define SDL_GetError
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.
uint64_t Uint64
An unsigned 64-bit integer type.
Definition: SDL_stdinc.h:170
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
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...
#define TEST_COMPLETED
#define NULL
Definition: begin_code.h:143
#define SDL_strcmp
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain)

◆ sdltest_randomIntegerInRange()

int sdltest_randomIntegerInRange ( void arg)

Calls to SDLTest_RandomIntegerInRange.

Definition at line 1041 of file testautomation_sdltest.c.

References SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), SDLTest_RandomSint16(), SDLTest_RandomUint8(), and TEST_COMPLETED.

1042 {
1043  Sint32 min, max;
1044  Sint32 result;
1045 #if ((ULONG_MAX) == (UINT_MAX))
1046  Sint32 long_min = LONG_MIN;
1047  Sint32 long_max = LONG_MAX;
1048 #else
1049  Sint32 long_min = INT_MIN;
1050  Sint32 long_max = INT_MAX;
1051 #endif
1052 
1053  /* Standard range */
1054  min = (Sint32)SDLTest_RandomSint16();
1055  max = min + (Sint32)SDLTest_RandomUint8() + 2;
1056  result = SDLTest_RandomIntegerInRange(min, max);
1057  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,max)");
1058  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
1059 
1060  /* One Range */
1061  min = (Sint32)SDLTest_RandomSint16();
1062  max = min + 1;
1063  result = SDLTest_RandomIntegerInRange(min, max);
1064  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min+1)");
1065  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
1066 
1067  /* Zero range */
1068  min = (Sint32)SDLTest_RandomSint16();
1069  max = min;
1070  result = SDLTest_RandomIntegerInRange(min, max);
1071  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min)");
1072  SDLTest_AssertCheck(min == result, "Validated returned value; expected: %d, got: %d", min, result);
1073 
1074  /* Zero range at zero */
1075  min = 0;
1076  max = 0;
1077  result = SDLTest_RandomIntegerInRange(min, max);
1078  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)");
1079  SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %d", result);
1080 
1081  /* Swapped min-max */
1082  min = (Sint32)SDLTest_RandomSint16();
1083  max = min + (Sint32)SDLTest_RandomUint8() + 2;
1084  result = SDLTest_RandomIntegerInRange(max, min);
1085  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)");
1086  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
1087 
1088  /* Range with min at integer limit */
1089  min = long_min;
1090  max = long_max + (Sint32)SDLTest_RandomSint16();
1091  result = SDLTest_RandomIntegerInRange(min, max);
1092  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)");
1093  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
1094 
1095  /* Range with max at integer limit */
1096  min = long_min - (Sint32)SDLTest_RandomSint16();
1097  max = long_max;
1098  result = SDLTest_RandomIntegerInRange(min, max);
1099  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)");
1100  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
1101 
1102  /* Full integer range */
1103  min = long_min;
1104  max = long_max;
1105  result = SDLTest_RandomIntegerInRange(min, max);
1106  SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,SINT32_MAX)");
1107  SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%d,%d], got: %d", min, max, result);
1108 
1109  return TEST_COMPLETED;
1110 }
GLuint64EXT * result
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
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.
Sint16 SDLTest_RandomSint16()
Uint8 SDLTest_RandomUint8()
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...
int32_t Sint32
Definition: SDL_stdinc.h:157
#define TEST_COMPLETED

◆ sdltest_randomNumber()

int sdltest_randomNumber ( void arg)

Calls to random number generators.

Definition at line 85 of file testautomation_sdltest.c.

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.

86 {
87  Sint64 result;
88  Uint64 uresult;
89  double dresult;
90  Uint64 umax;
91  Sint64 min, max;
92 
93  result = (Sint64)SDLTest_RandomUint8();
94  umax = (1 << 8) - 1;
95  SDLTest_AssertPass("Call to SDLTest_RandomUint8");
96  SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result);
97 
98  result = (Sint64)SDLTest_RandomSint8();
99  min = 0 - (1 << 7);
100  max = (1 << 7) - 1;
101  SDLTest_AssertPass("Call to SDLTest_RandomSint8");
102  SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result);
103 
104  result = (Sint64)SDLTest_RandomUint16();
105  umax = (1 << 16) - 1;
106  SDLTest_AssertPass("Call to SDLTest_RandomUint16");
107  SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result);
108 
109  result = (Sint64)SDLTest_RandomSint16();
110  min = 0 - (1 << 15);
111  max = (1 << 15) - 1;
112  SDLTest_AssertPass("Call to SDLTest_RandomSint16");
113  SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result);
114 
115  result = (Sint64)SDLTest_RandomUint32();
116  umax = ((Uint64)1 << 32) - 1;
117  SDLTest_AssertPass("Call to SDLTest_RandomUint32");
118  SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%"SDL_PRIu64"], got: %"SDL_PRIs64, umax, result);
119 
120  result = (Sint64)SDLTest_RandomSint32();
121  min = 0 - ((Sint64)1 << 31);
122  max = ((Sint64)1 << 31) - 1;
123  SDLTest_AssertPass("Call to SDLTest_RandomSint32");
124  SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%"SDL_PRIs64",%"SDL_PRIs64"], got: %"SDL_PRIs64, min, max, result);
125 
126  uresult = SDLTest_RandomUint64();
127  SDLTest_AssertPass("Call to SDLTest_RandomUint64");
128 
129  result = SDLTest_RandomSint64();
130  SDLTest_AssertPass("Call to SDLTest_RandomSint64");
131 
132  dresult = (double)SDLTest_RandomUnitFloat();
133  SDLTest_AssertPass("Call to SDLTest_RandomUnitFloat");
134  SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult);
135 
136  dresult = (double)SDLTest_RandomFloat();
137  SDLTest_AssertPass("Call to SDLTest_RandomFloat");
138  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);
139 
140  dresult = (double)SDLTest_RandomUnitDouble();
141  SDLTest_AssertPass("Call to SDLTest_RandomUnitDouble");
142  SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult);
143 
144  dresult = SDLTest_RandomDouble();
145  SDLTest_AssertPass("Call to SDLTest_RandomDouble");
146 
147  return TEST_COMPLETED;
148 }
GLuint64EXT * result
Sint32 SDLTest_RandomSint32()
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.
Sint16 SDLTest_RandomSint16()
uint64_t Uint64
An unsigned 64-bit integer type.
Definition: SDL_stdinc.h:170
double SDLTest_RandomUnitDouble()
Uint8 SDLTest_RandomUint8()
Sint8 SDLTest_RandomSint8()
#define SDL_PRIs64
Definition: SDL_stdinc.h:181
Uint32 SDLTest_RandomUint32()
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...
#define TEST_COMPLETED
Uint16 SDLTest_RandomUint16()
Sint64 SDLTest_RandomSint64()
Uint64 SDLTest_RandomUint64()
float SDLTest_RandomFloat()
#define SDL_PRIu64
Definition: SDL_stdinc.h:192
float SDLTest_RandomUnitFloat()
int64_t Sint64
A signed 64-bit integer type.
Definition: SDL_stdinc.h:166
double SDLTest_RandomDouble()

Variable Documentation

◆ sdltestTest1

const SDLTest_TestCaseReference sdltestTest1
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_getFuzzerInvocationCount, "sdltest_getFuzzerInvocationCount", "Call to sdltest_GetFuzzerInvocationCount", TEST_ENABLED }
int sdltest_getFuzzerInvocationCount(void *arg)
Calls to SDLTest_GetFuzzerInvocationCount()
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1257 of file testautomation_sdltest.c.

◆ sdltestTest10

const SDLTest_TestCaseReference sdltestTest10
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint64, "sdltest_randomBoundaryNumberSint64", "Calls to random boundary number generators for Sint64", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomBoundaryNumberSint64(void *arg)

Definition at line 1284 of file testautomation_sdltest.c.

◆ sdltestTest11

const SDLTest_TestCaseReference sdltestTest11
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomIntegerInRange, "sdltest_randomIntegerInRange", "Calls to ranged random number generator", TEST_ENABLED }
int sdltest_randomIntegerInRange(void *arg)
Calls to SDLTest_RandomIntegerInRange.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1287 of file testautomation_sdltest.c.

◆ sdltestTest12

const SDLTest_TestCaseReference sdltestTest12
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomAsciiString, "sdltest_randomAsciiString", "Calls to default ASCII string generator", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomAsciiString(void *arg)
Calls to SDLTest_RandomAsciiString.

Definition at line 1290 of file testautomation_sdltest.c.

◆ sdltestTest13

const SDLTest_TestCaseReference sdltestTest13
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomAsciiStringWithMaximumLength, "sdltest_randomAsciiStringWithMaximumLength", "Calls to random maximum length ASCII string generator", TEST_ENABLED }
int sdltest_randomAsciiStringWithMaximumLength(void *arg)
Calls to SDLTest_RandomAsciiStringWithMaximumLength.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1293 of file testautomation_sdltest.c.

◆ sdltestTest14

const SDLTest_TestCaseReference sdltestTest14
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomAsciiStringOfSize, "sdltest_randomAsciiStringOfSize", "Calls to fixed size ASCII string generator", TEST_ENABLED }
int sdltest_randomAsciiStringOfSize(void *arg)
Calls to SDLTest_RandomAsciiStringOfSize.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1296 of file testautomation_sdltest.c.

◆ sdltestTest15

const SDLTest_TestCaseReference sdltestTest15
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_generateRunSeed, "sdltest_generateRunSeed", "Checks internal harness function SDLTest_GenerateRunSeed", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_generateRunSeed(void *arg)
Calls to SDLTest_GenerateRunSeed()

Definition at line 1299 of file testautomation_sdltest.c.

◆ sdltestTest2

const SDLTest_TestCaseReference sdltestTest2
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomNumber, "sdltest_randomNumber", "Calls to random number generators", TEST_ENABLED }
int sdltest_randomNumber(void *arg)
Calls to random number generators.
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1260 of file testautomation_sdltest.c.

◆ sdltestTest3

const SDLTest_TestCaseReference sdltestTest3
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint8, "sdltest_randomBoundaryNumberUint8", "Calls to random boundary number generators for Uint8", TEST_ENABLED }
int sdltest_randomBoundaryNumberUint8(void *arg)
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1263 of file testautomation_sdltest.c.

◆ sdltestTest4

const SDLTest_TestCaseReference sdltestTest4
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint16, "sdltest_randomBoundaryNumberUint16", "Calls to random boundary number generators for Uint16", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomBoundaryNumberUint16(void *arg)

Definition at line 1266 of file testautomation_sdltest.c.

◆ sdltestTest5

const SDLTest_TestCaseReference sdltestTest5
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint32, "sdltest_randomBoundaryNumberUint32", "Calls to random boundary number generators for Uint32", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomBoundaryNumberUint32(void *arg)

Definition at line 1269 of file testautomation_sdltest.c.

◆ sdltestTest6

const SDLTest_TestCaseReference sdltestTest6
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint64, "sdltest_randomBoundaryNumberUint64", "Calls to random boundary number generators for Uint64", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomBoundaryNumberUint64(void *arg)

Definition at line 1272 of file testautomation_sdltest.c.

◆ sdltestTest7

const SDLTest_TestCaseReference sdltestTest7
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint8, "sdltest_randomBoundaryNumberSint8", "Calls to random boundary number generators for Sint8", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomBoundaryNumberSint8(void *arg)

Definition at line 1275 of file testautomation_sdltest.c.

◆ sdltestTest8

const SDLTest_TestCaseReference sdltestTest8
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint16, "sdltest_randomBoundaryNumberSint16", "Calls to random boundary number generators for Sint16", TEST_ENABLED }
int sdltest_randomBoundaryNumberSint16(void *arg)
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED

Definition at line 1278 of file testautomation_sdltest.c.

◆ sdltestTest9

const SDLTest_TestCaseReference sdltestTest9
static
Initial value:
=
{ (SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint32, "sdltest_randomBoundaryNumberSint32", "Calls to random boundary number generators for Sint32", TEST_ENABLED }
int(* SDLTest_TestCaseFp)(void *arg)
#define TEST_ENABLED
int sdltest_randomBoundaryNumberSint32(void *arg)

Definition at line 1281 of file testautomation_sdltest.c.

◆ sdltestTests

const SDLTest_TestCaseReference* sdltestTests[]
static
Initial value:
= {
}
static const SDLTest_TestCaseReference sdltestTest2
static const SDLTest_TestCaseReference sdltestTest9
static const SDLTest_TestCaseReference sdltestTest1
static const SDLTest_TestCaseReference sdltestTest11
static const SDLTest_TestCaseReference sdltestTest14
static const SDLTest_TestCaseReference sdltestTest10
static const SDLTest_TestCaseReference sdltestTest7
static const SDLTest_TestCaseReference sdltestTest4
static const SDLTest_TestCaseReference sdltestTest12
static const SDLTest_TestCaseReference sdltestTest6
static const SDLTest_TestCaseReference sdltestTest3
static const SDLTest_TestCaseReference sdltestTest5
static const SDLTest_TestCaseReference sdltestTest15
#define NULL
Definition: begin_code.h:143
static const SDLTest_TestCaseReference sdltestTest13
static const SDLTest_TestCaseReference sdltestTest8

Definition at line 1303 of file testautomation_sdltest.c.

◆ sdltestTestSuite

SDLTest_TestSuiteReference sdltestTestSuite
Initial value:
= {
"SDLtest",
}
static const SDLTest_TestCaseReference * sdltestTests[]
#define NULL
Definition: begin_code.h:143

Definition at line 1310 of file testautomation_sdltest.c.