| 1 |
/** |
| 2 |
* SDL_test test suite |
| 3 |
*/ |
| 4 |
|
| 5 |
#include <limits.h> |
| 6 |
/* Visual Studio 2008 doesn't have stdint.h */ |
| 7 |
#if defined(_MSC_VER) && _MSC_VER <= 1500 |
| 8 |
#define UINT8_MAX _UI8_MAX |
| 9 |
#define UINT16_MAX _UI16_MAX |
| 10 |
#define UINT32_MAX _UI32_MAX |
| 11 |
#define INT64_MIN _I64_MIN |
| 12 |
#define INT64_MAX _I64_MAX |
| 13 |
#define UINT64_MAX _UI64_MAX |
| 14 |
#else |
| 15 |
#include <stdint.h> |
| 16 |
#endif |
| 17 |
|
| 18 |
#include <stdio.h> |
| 19 |
#include <float.h> |
| 20 |
#include <ctype.h> |
| 21 |
|
| 22 |
#include "SDL.h" |
| 23 |
#include "SDL_test.h" |
| 24 |
|
| 25 |
/* Test case functions */ |
| 26 |
|
| 27 |
/** |
| 28 |
* @brief Calls to SDLTest_GenerateRunSeed() |
| 29 |
*/ |
| 30 |
int sdltest_generateRunSeed(void *arg) |
| 31 |
{ |
| 32 |
char *result; |
| 33 |
size_t i, l; |
| 34 |
int j; |
| 35 |
|
| 36 |
for (i = 1; i <= 10; i += 3) { |
| 37 |
result = SDLTest_GenerateRunSeed((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", (int)i, (int)l); |
| 43 |
SDL_free(result); |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
/* Negative cases */ |
| 48 |
for (j = -2; j <= 0; j++) { |
| 49 |
result = SDLTest_GenerateRunSeed(j); |
| 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 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* @brief Calls to SDLTest_GetFuzzerInvocationCount() |
| 59 |
*/ |
| 60 |
int sdltest_getFuzzerInvocationCount(void *arg) |
| 61 |
{ |
| 62 |
Uint8 result; |
| 63 |
int fuzzerCount1, fuzzerCount2; |
| 64 |
|
| 65 |
fuzzerCount1 = SDLTest_GetFuzzerInvocationCount(); |
| 66 |
SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); |
| 67 |
SDLTest_AssertCheck(fuzzerCount1 >= 0, "Verify returned value, expected: >=0, got: %d", fuzzerCount1); |
| 68 |
|
| 69 |
result = SDLTest_RandomUint8(); |
| 70 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8(), returned %d", result); |
| 71 |
|
| 72 |
fuzzerCount2 = SDLTest_GetFuzzerInvocationCount(); |
| 73 |
SDLTest_AssertPass("Call to SDLTest_GetFuzzerInvocationCount()"); |
| 74 |
SDLTest_AssertCheck(fuzzerCount2 > fuzzerCount1, "Verify returned value, expected: >%d, got: %d", fuzzerCount1, fuzzerCount2); |
| 75 |
|
| 76 |
return TEST_COMPLETED; |
| 77 |
} |
| 78 |
|
| 79 |
/** |
| 80 |
* @brief Calls to random number generators |
| 81 |
*/ |
| 82 |
int sdltest_randomNumber(void *arg) |
| 83 |
{ |
| 84 |
Sint64 result; |
| 85 |
double dresult; |
| 86 |
Uint64 umax; |
| 87 |
Sint64 min, max; |
| 88 |
|
| 89 |
result = (Sint64)SDLTest_RandomUint8(); |
| 90 |
umax = (1 << 8) - 1; |
| 91 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8"); |
| 92 |
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%" SDL_PRIu64 "], got: %" SDL_PRIs64, umax, result); |
| 93 |
|
| 94 |
result = (Sint64)SDLTest_RandomSint8(); |
| 95 |
min = 0 - (1 << 7); |
| 96 |
max = (1 << 7) - 1; |
| 97 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8"); |
| 98 |
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%" SDL_PRIs64 ",%" SDL_PRIs64 "], got: %" SDL_PRIs64, min, max, result); |
| 99 |
|
| 100 |
result = (Sint64)SDLTest_RandomUint16(); |
| 101 |
umax = (1 << 16) - 1; |
| 102 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16"); |
| 103 |
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%" SDL_PRIu64 "], got: %" SDL_PRIs64, umax, result); |
| 104 |
|
| 105 |
result = (Sint64)SDLTest_RandomSint16(); |
| 106 |
min = 0 - (1 << 15); |
| 107 |
max = (1 << 15) - 1; |
| 108 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16"); |
| 109 |
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%" SDL_PRIs64 ",%" SDL_PRIs64 "], got: %" SDL_PRIs64, min, max, result); |
| 110 |
|
| 111 |
result = (Sint64)SDLTest_RandomUint32(); |
| 112 |
umax = ((Uint64)1 << 32) - 1; |
| 113 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32"); |
| 114 |
SDLTest_AssertCheck(result >= 0 && result <= (Sint64)umax, "Verify result value, expected: [0,%" SDL_PRIu64 "], got: %" SDL_PRIs64, umax, result); |
| 115 |
|
| 116 |
result = (Sint64)SDLTest_RandomSint32(); |
| 117 |
min = 0 - ((Sint64)1 << 31); |
| 118 |
max = ((Sint64)1 << 31) - 1; |
| 119 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32"); |
| 120 |
SDLTest_AssertCheck(result >= min && result <= max, "Verify result value, expected: [%" SDL_PRIs64 ",%" SDL_PRIs64 "], got: %" SDL_PRIs64, min, max, result); |
| 121 |
|
| 122 |
SDLTest_RandomUint64(); |
| 123 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64"); |
| 124 |
|
| 125 |
result = SDLTest_RandomSint64(); |
| 126 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64"); |
| 127 |
|
| 128 |
dresult = (double)SDLTest_RandomUnitFloat(); |
| 129 |
SDLTest_AssertPass("Call to SDLTest_RandomUnitFloat"); |
| 130 |
SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); |
| 131 |
|
| 132 |
dresult = (double)SDLTest_RandomFloat(); |
| 133 |
SDLTest_AssertPass("Call to SDLTest_RandomFloat"); |
| 134 |
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); |
| 135 |
|
| 136 |
dresult = SDLTest_RandomUnitDouble(); |
| 137 |
SDLTest_AssertPass("Call to SDLTest_RandomUnitDouble"); |
| 138 |
SDLTest_AssertCheck(dresult >= 0.0 && dresult < 1.0, "Verify result value, expected: [0.0,1.0[, got: %e", dresult); |
| 139 |
|
| 140 |
dresult = SDLTest_RandomDouble(); |
| 141 |
SDLTest_AssertPass("Call to SDLTest_RandomDouble"); |
| 142 |
|
| 143 |
return TEST_COMPLETED; |
| 144 |
} |
| 145 |
|
| 146 |
/* |
| 147 |
* @brief Calls to random boundary number generators for Uint8 |
| 148 |
*/ |
| 149 |
int sdltest_randomBoundaryNumberUint8(void *arg) |
| 150 |
{ |
| 151 |
const char *expectedError = "That operation is not supported"; |
| 152 |
char *lastError; |
| 153 |
Uint64 uresult; |
| 154 |
|
| 155 |
/* Clean error messages */ |
| 156 |
SDL_ClearError(); |
| 157 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 158 |
|
| 159 |
/* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 160 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 10, SDL_TRUE); |
| 161 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 162 |
SDLTest_AssertCheck( |
| 163 |
uresult == 10, |
| 164 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); |
| 165 |
|
| 166 |
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 167 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 11, SDL_TRUE); |
| 168 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 169 |
SDLTest_AssertCheck( |
| 170 |
uresult == 10 || uresult == 11, |
| 171 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); |
| 172 |
|
| 173 |
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 174 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 12, SDL_TRUE); |
| 175 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 176 |
SDLTest_AssertCheck( |
| 177 |
uresult == 10 || uresult == 11 || uresult == 12, |
| 178 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); |
| 179 |
|
| 180 |
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 181 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 13, SDL_TRUE); |
| 182 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 183 |
SDLTest_AssertCheck( |
| 184 |
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, |
| 185 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); |
| 186 |
|
| 187 |
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 188 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(10, 20, SDL_TRUE); |
| 189 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 190 |
SDLTest_AssertCheck( |
| 191 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 192 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 193 |
|
| 194 |
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 195 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(20, 10, SDL_TRUE); |
| 196 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 197 |
SDLTest_AssertCheck( |
| 198 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 199 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 200 |
|
| 201 |
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 202 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 20, SDL_FALSE); |
| 203 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 204 |
SDLTest_AssertCheck( |
| 205 |
uresult == 0 || uresult == 21, |
| 206 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); |
| 207 |
|
| 208 |
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ |
| 209 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 99, SDL_FALSE); |
| 210 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 211 |
SDLTest_AssertCheck( |
| 212 |
uresult == 100, |
| 213 |
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); |
| 214 |
|
| 215 |
/* RandomUintXBoundaryValue(1, 0xff, SDL_FALSE) returns 0 (no error) */ |
| 216 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(1, 255, SDL_FALSE); |
| 217 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 218 |
SDLTest_AssertCheck( |
| 219 |
uresult == 0, |
| 220 |
"Validate result value for parameters (1,255,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 221 |
lastError = (char *)SDL_GetError(); |
| 222 |
SDLTest_AssertPass("SDL_GetError()"); |
| 223 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 224 |
|
| 225 |
/* RandomUintXBoundaryValue(0, 0xfe, SDL_FALSE) returns 0xff (no error) */ |
| 226 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 254, SDL_FALSE); |
| 227 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 228 |
SDLTest_AssertCheck( |
| 229 |
uresult == 0xff, |
| 230 |
"Validate result value for parameters (0,254,SDL_FALSE); expected: 0xff, got: %" SDL_PRIs64, uresult); |
| 231 |
lastError = (char *)SDL_GetError(); |
| 232 |
SDLTest_AssertPass("SDL_GetError()"); |
| 233 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 234 |
|
| 235 |
/* RandomUintXBoundaryValue(0, 0xff, SDL_FALSE) returns 0 (sets error) */ |
| 236 |
uresult = (Uint64)SDLTest_RandomUint8BoundaryValue(0, 255, SDL_FALSE); |
| 237 |
SDLTest_AssertPass("Call to SDLTest_RandomUint8BoundaryValue"); |
| 238 |
SDLTest_AssertCheck( |
| 239 |
uresult == 0, |
| 240 |
"Validate result value for parameters(0,255,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 241 |
lastError = (char *)SDL_GetError(); |
| 242 |
SDLTest_AssertPass("SDL_GetError()"); |
| 243 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 244 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 245 |
expectedError, |
| 246 |
lastError); |
| 247 |
|
| 248 |
/* Clear error messages */ |
| 249 |
SDL_ClearError(); |
| 250 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 251 |
|
| 252 |
return TEST_COMPLETED; |
| 253 |
} |
| 254 |
|
| 255 |
/* |
| 256 |
* @brief Calls to random boundary number generators for Uint16 |
| 257 |
*/ |
| 258 |
int sdltest_randomBoundaryNumberUint16(void *arg) |
| 259 |
{ |
| 260 |
const char *expectedError = "That operation is not supported"; |
| 261 |
char *lastError; |
| 262 |
Uint64 uresult; |
| 263 |
|
| 264 |
/* Clean error messages */ |
| 265 |
SDL_ClearError(); |
| 266 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 267 |
|
| 268 |
/* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 269 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 10, SDL_TRUE); |
| 270 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 271 |
SDLTest_AssertCheck( |
| 272 |
uresult == 10, |
| 273 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); |
| 274 |
|
| 275 |
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 276 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 11, SDL_TRUE); |
| 277 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 278 |
SDLTest_AssertCheck( |
| 279 |
uresult == 10 || uresult == 11, |
| 280 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); |
| 281 |
|
| 282 |
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 283 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 12, SDL_TRUE); |
| 284 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 285 |
SDLTest_AssertCheck( |
| 286 |
uresult == 10 || uresult == 11 || uresult == 12, |
| 287 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); |
| 288 |
|
| 289 |
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 290 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 13, SDL_TRUE); |
| 291 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 292 |
SDLTest_AssertCheck( |
| 293 |
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, |
| 294 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); |
| 295 |
|
| 296 |
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 297 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(10, 20, SDL_TRUE); |
| 298 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 299 |
SDLTest_AssertCheck( |
| 300 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 301 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 302 |
|
| 303 |
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 304 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(20, 10, SDL_TRUE); |
| 305 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 306 |
SDLTest_AssertCheck( |
| 307 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 308 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 309 |
|
| 310 |
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 311 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 20, SDL_FALSE); |
| 312 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 313 |
SDLTest_AssertCheck( |
| 314 |
uresult == 0 || uresult == 21, |
| 315 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); |
| 316 |
|
| 317 |
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ |
| 318 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 99, SDL_FALSE); |
| 319 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 320 |
SDLTest_AssertCheck( |
| 321 |
uresult == 100, |
| 322 |
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); |
| 323 |
|
| 324 |
/* RandomUintXBoundaryValue(1, 0xffff, SDL_FALSE) returns 0 (no error) */ |
| 325 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(1, 0xffff, SDL_FALSE); |
| 326 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 327 |
SDLTest_AssertCheck( |
| 328 |
uresult == 0, |
| 329 |
"Validate result value for parameters (1,0xffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 330 |
lastError = (char *)SDL_GetError(); |
| 331 |
SDLTest_AssertPass("SDL_GetError()"); |
| 332 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 333 |
|
| 334 |
/* RandomUintXBoundaryValue(0, 0xfffe, SDL_FALSE) returns 0xffff (no error) */ |
| 335 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xfffe, SDL_FALSE); |
| 336 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 337 |
SDLTest_AssertCheck( |
| 338 |
uresult == 0xffff, |
| 339 |
"Validate result value for parameters (0,0xfffe,SDL_FALSE); expected: 0xffff, got: %" SDL_PRIs64, uresult); |
| 340 |
lastError = (char *)SDL_GetError(); |
| 341 |
SDLTest_AssertPass("SDL_GetError()"); |
| 342 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 343 |
|
| 344 |
/* RandomUintXBoundaryValue(0, 0xffff, SDL_FALSE) returns 0 (sets error) */ |
| 345 |
uresult = (Uint64)SDLTest_RandomUint16BoundaryValue(0, 0xffff, SDL_FALSE); |
| 346 |
SDLTest_AssertPass("Call to SDLTest_RandomUint16BoundaryValue"); |
| 347 |
SDLTest_AssertCheck( |
| 348 |
uresult == 0, |
| 349 |
"Validate result value for parameters(0,0xffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 350 |
lastError = (char *)SDL_GetError(); |
| 351 |
SDLTest_AssertPass("SDL_GetError()"); |
| 352 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 353 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 354 |
expectedError, |
| 355 |
lastError); |
| 356 |
|
| 357 |
/* Clear error messages */ |
| 358 |
SDL_ClearError(); |
| 359 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 360 |
|
| 361 |
return TEST_COMPLETED; |
| 362 |
} |
| 363 |
|
| 364 |
/* |
| 365 |
* @brief Calls to random boundary number generators for Uint32 |
| 366 |
*/ |
| 367 |
int sdltest_randomBoundaryNumberUint32(void *arg) |
| 368 |
{ |
| 369 |
const char *expectedError = "That operation is not supported"; |
| 370 |
char *lastError; |
| 371 |
Uint64 uresult; |
| 372 |
|
| 373 |
/* Clean error messages */ |
| 374 |
SDL_ClearError(); |
| 375 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 376 |
|
| 377 |
/* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 378 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 10, SDL_TRUE); |
| 379 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 380 |
SDLTest_AssertCheck( |
| 381 |
uresult == 10, |
| 382 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); |
| 383 |
|
| 384 |
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 385 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 11, SDL_TRUE); |
| 386 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 387 |
SDLTest_AssertCheck( |
| 388 |
uresult == 10 || uresult == 11, |
| 389 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); |
| 390 |
|
| 391 |
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 392 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 12, SDL_TRUE); |
| 393 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 394 |
SDLTest_AssertCheck( |
| 395 |
uresult == 10 || uresult == 11 || uresult == 12, |
| 396 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); |
| 397 |
|
| 398 |
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 399 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 13, SDL_TRUE); |
| 400 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 401 |
SDLTest_AssertCheck( |
| 402 |
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, |
| 403 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); |
| 404 |
|
| 405 |
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 406 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(10, 20, SDL_TRUE); |
| 407 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 408 |
SDLTest_AssertCheck( |
| 409 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 410 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 411 |
|
| 412 |
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 413 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(20, 10, SDL_TRUE); |
| 414 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 415 |
SDLTest_AssertCheck( |
| 416 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 417 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 418 |
|
| 419 |
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 420 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 20, SDL_FALSE); |
| 421 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 422 |
SDLTest_AssertCheck( |
| 423 |
uresult == 0 || uresult == 21, |
| 424 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); |
| 425 |
|
| 426 |
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ |
| 427 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 99, SDL_FALSE); |
| 428 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 429 |
SDLTest_AssertCheck( |
| 430 |
uresult == 100, |
| 431 |
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); |
| 432 |
|
| 433 |
/* RandomUintXBoundaryValue(1, 0xffffffff, SDL_FALSE) returns 0 (no error) */ |
| 434 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(1, 0xffffffff, SDL_FALSE); |
| 435 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 436 |
SDLTest_AssertCheck( |
| 437 |
uresult == 0, |
| 438 |
"Validate result value for parameters (1,0xffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 439 |
lastError = (char *)SDL_GetError(); |
| 440 |
SDLTest_AssertPass("SDL_GetError()"); |
| 441 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 442 |
|
| 443 |
/* RandomUintXBoundaryValue(0, 0xfffffffe, SDL_FALSE) returns 0xffffffff (no error) */ |
| 444 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xfffffffe, SDL_FALSE); |
| 445 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 446 |
SDLTest_AssertCheck( |
| 447 |
uresult == 0xffffffff, |
| 448 |
"Validate result value for parameters (0,0xfffffffe,SDL_FALSE); expected: 0xffffffff, got: %" SDL_PRIs64, uresult); |
| 449 |
lastError = (char *)SDL_GetError(); |
| 450 |
SDLTest_AssertPass("SDL_GetError()"); |
| 451 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 452 |
|
| 453 |
/* RandomUintXBoundaryValue(0, 0xffffffff, SDL_FALSE) returns 0 (sets error) */ |
| 454 |
uresult = (Uint64)SDLTest_RandomUint32BoundaryValue(0, 0xffffffff, SDL_FALSE); |
| 455 |
SDLTest_AssertPass("Call to SDLTest_RandomUint32BoundaryValue"); |
| 456 |
SDLTest_AssertCheck( |
| 457 |
uresult == 0, |
| 458 |
"Validate result value for parameters(0,0xffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 459 |
lastError = (char *)SDL_GetError(); |
| 460 |
SDLTest_AssertPass("SDL_GetError()"); |
| 461 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 462 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 463 |
expectedError, |
| 464 |
lastError); |
| 465 |
|
| 466 |
/* Clear error messages */ |
| 467 |
SDL_ClearError(); |
| 468 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 469 |
|
| 470 |
return TEST_COMPLETED; |
| 471 |
} |
| 472 |
|
| 473 |
/* |
| 474 |
* @brief Calls to random boundary number generators for Uint64 |
| 475 |
*/ |
| 476 |
int sdltest_randomBoundaryNumberUint64(void *arg) |
| 477 |
{ |
| 478 |
const char *expectedError = "That operation is not supported"; |
| 479 |
char *lastError; |
| 480 |
Uint64 uresult; |
| 481 |
|
| 482 |
/* Clean error messages */ |
| 483 |
SDL_ClearError(); |
| 484 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 485 |
|
| 486 |
/* RandomUintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 487 |
uresult = SDLTest_RandomUint64BoundaryValue(10, 10, SDL_TRUE); |
| 488 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 489 |
SDLTest_AssertCheck( |
| 490 |
uresult == 10, |
| 491 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, uresult); |
| 492 |
|
| 493 |
/* RandomUintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 494 |
uresult = SDLTest_RandomUint64BoundaryValue(10, 11, SDL_TRUE); |
| 495 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 496 |
SDLTest_AssertCheck( |
| 497 |
uresult == 10 || uresult == 11, |
| 498 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, uresult); |
| 499 |
|
| 500 |
/* RandomUintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 501 |
uresult = SDLTest_RandomUint64BoundaryValue(10, 12, SDL_TRUE); |
| 502 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 503 |
SDLTest_AssertCheck( |
| 504 |
uresult == 10 || uresult == 11 || uresult == 12, |
| 505 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, uresult); |
| 506 |
|
| 507 |
/* RandomUintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 508 |
uresult = SDLTest_RandomUint64BoundaryValue(10, 13, SDL_TRUE); |
| 509 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 510 |
SDLTest_AssertCheck( |
| 511 |
uresult == 10 || uresult == 11 || uresult == 12 || uresult == 13, |
| 512 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, uresult); |
| 513 |
|
| 514 |
/* RandomUintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 515 |
uresult = SDLTest_RandomUint64BoundaryValue(10, 20, SDL_TRUE); |
| 516 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 517 |
SDLTest_AssertCheck( |
| 518 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 519 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 520 |
|
| 521 |
/* RandomUintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 522 |
uresult = SDLTest_RandomUint64BoundaryValue(20, 10, SDL_TRUE); |
| 523 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 524 |
SDLTest_AssertCheck( |
| 525 |
uresult == 10 || uresult == 11 || uresult == 19 || uresult == 20, |
| 526 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, uresult); |
| 527 |
|
| 528 |
/* RandomUintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 529 |
uresult = SDLTest_RandomUint64BoundaryValue(1, 20, SDL_FALSE); |
| 530 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 531 |
SDLTest_AssertCheck( |
| 532 |
uresult == 0 || uresult == 21, |
| 533 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, uresult); |
| 534 |
|
| 535 |
/* RandomUintXBoundaryValue(0, 99, SDL_FALSE) returns 100 */ |
| 536 |
uresult = SDLTest_RandomUint64BoundaryValue(0, 99, SDL_FALSE); |
| 537 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 538 |
SDLTest_AssertCheck( |
| 539 |
uresult == 100, |
| 540 |
"Validate result value for parameters (0,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, uresult); |
| 541 |
|
| 542 |
/* RandomUintXBoundaryValue(1, 0xffffffffffffffff, SDL_FALSE) returns 0 (no error) */ |
| 543 |
uresult = SDLTest_RandomUint64BoundaryValue(1, 0xffffffffffffffffULL, SDL_FALSE); |
| 544 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 545 |
SDLTest_AssertCheck( |
| 546 |
uresult == 0, |
| 547 |
"Validate result value for parameters (1,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 548 |
lastError = (char *)SDL_GetError(); |
| 549 |
SDLTest_AssertPass("SDL_GetError()"); |
| 550 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 551 |
|
| 552 |
/* RandomUintXBoundaryValue(0, 0xfffffffffffffffe, SDL_FALSE) returns 0xffffffffffffffff (no error) */ |
| 553 |
uresult = SDLTest_RandomUint64BoundaryValue(0, 0xfffffffffffffffeULL, SDL_FALSE); |
| 554 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 555 |
SDLTest_AssertCheck( |
| 556 |
uresult == 0xffffffffffffffffULL, |
| 557 |
"Validate result value for parameters (0,0xfffffffffffffffe,SDL_FALSE); expected: 0xffffffffffffffff, got: %" SDL_PRIs64, uresult); |
| 558 |
lastError = (char *)SDL_GetError(); |
| 559 |
SDLTest_AssertPass("SDL_GetError()"); |
| 560 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 561 |
|
| 562 |
/* RandomUintXBoundaryValue(0, 0xffffffffffffffff, SDL_FALSE) returns 0 (sets error) */ |
| 563 |
uresult = SDLTest_RandomUint64BoundaryValue(0, 0xffffffffffffffffULL, SDL_FALSE); |
| 564 |
SDLTest_AssertPass("Call to SDLTest_RandomUint64BoundaryValue"); |
| 565 |
SDLTest_AssertCheck( |
| 566 |
uresult == 0, |
| 567 |
"Validate result value for parameters(0,0xffffffffffffffff,SDL_FALSE); expected: 0, got: %" SDL_PRIs64, uresult); |
| 568 |
lastError = (char *)SDL_GetError(); |
| 569 |
SDLTest_AssertPass("SDL_GetError()"); |
| 570 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 571 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 572 |
expectedError, |
| 573 |
lastError); |
| 574 |
|
| 575 |
/* Clear error messages */ |
| 576 |
SDL_ClearError(); |
| 577 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 578 |
|
| 579 |
return TEST_COMPLETED; |
| 580 |
} |
| 581 |
|
| 582 |
/* |
| 583 |
* @brief Calls to random boundary number generators for Sint8 |
| 584 |
*/ |
| 585 |
int sdltest_randomBoundaryNumberSint8(void *arg) |
| 586 |
{ |
| 587 |
const char *expectedError = "That operation is not supported"; |
| 588 |
char *lastError; |
| 589 |
Sint64 sresult; |
| 590 |
|
| 591 |
/* Clean error messages */ |
| 592 |
SDL_ClearError(); |
| 593 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 594 |
|
| 595 |
/* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 596 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 10, SDL_TRUE); |
| 597 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 598 |
SDLTest_AssertCheck( |
| 599 |
sresult == 10, |
| 600 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); |
| 601 |
|
| 602 |
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 603 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 11, SDL_TRUE); |
| 604 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 605 |
SDLTest_AssertCheck( |
| 606 |
sresult == 10 || sresult == 11, |
| 607 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); |
| 608 |
|
| 609 |
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 610 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 12, SDL_TRUE); |
| 611 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 612 |
SDLTest_AssertCheck( |
| 613 |
sresult == 10 || sresult == 11 || sresult == 12, |
| 614 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); |
| 615 |
|
| 616 |
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 617 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 13, SDL_TRUE); |
| 618 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 619 |
SDLTest_AssertCheck( |
| 620 |
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, |
| 621 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); |
| 622 |
|
| 623 |
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 624 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(10, 20, SDL_TRUE); |
| 625 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 626 |
SDLTest_AssertCheck( |
| 627 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 628 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 629 |
|
| 630 |
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 631 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(20, 10, SDL_TRUE); |
| 632 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 633 |
SDLTest_AssertCheck( |
| 634 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 635 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 636 |
|
| 637 |
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 638 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(1, 20, SDL_FALSE); |
| 639 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 640 |
SDLTest_AssertCheck( |
| 641 |
sresult == 0 || sresult == 21, |
| 642 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); |
| 643 |
|
| 644 |
/* RandomSintXBoundaryValue(SCHAR_MIN, 99, SDL_FALSE) returns 100 */ |
| 645 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, 99, SDL_FALSE); |
| 646 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 647 |
SDLTest_AssertCheck( |
| 648 |
sresult == 100, |
| 649 |
"Validate result value for parameters (SCHAR_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); |
| 650 |
|
| 651 |
/* RandomSintXBoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (no error) */ |
| 652 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN + 1, SCHAR_MAX, SDL_FALSE); |
| 653 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 654 |
SDLTest_AssertCheck( |
| 655 |
sresult == SCHAR_MIN, |
| 656 |
"Validate result value for parameters (SCHAR_MIN + 1,SCHAR_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); |
| 657 |
lastError = (char *)SDL_GetError(); |
| 658 |
SDLTest_AssertPass("SDL_GetError()"); |
| 659 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 660 |
|
| 661 |
/* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE) returns SCHAR_MAX (no error) */ |
| 662 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX - 1, SDL_FALSE); |
| 663 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 664 |
SDLTest_AssertCheck( |
| 665 |
sresult == SCHAR_MAX, |
| 666 |
"Validate result value for parameters (SCHAR_MIN,SCHAR_MAX - 1,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MAX, sresult); |
| 667 |
lastError = (char *)SDL_GetError(); |
| 668 |
SDLTest_AssertPass("SDL_GetError()"); |
| 669 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 670 |
|
| 671 |
/* RandomSintXBoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE) returns SCHAR_MIN (sets error) */ |
| 672 |
sresult = (Sint64)SDLTest_RandomSint8BoundaryValue(SCHAR_MIN, SCHAR_MAX, SDL_FALSE); |
| 673 |
SDLTest_AssertPass("Call to SDLTest_RandomSint8BoundaryValue"); |
| 674 |
SDLTest_AssertCheck( |
| 675 |
sresult == SCHAR_MIN, |
| 676 |
"Validate result value for parameters(SCHAR_MIN,SCHAR_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SCHAR_MIN, sresult); |
| 677 |
lastError = (char *)SDL_GetError(); |
| 678 |
SDLTest_AssertPass("SDL_GetError()"); |
| 679 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 680 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 681 |
expectedError, |
| 682 |
lastError); |
| 683 |
|
| 684 |
/* Clear error messages */ |
| 685 |
SDL_ClearError(); |
| 686 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 687 |
|
| 688 |
return TEST_COMPLETED; |
| 689 |
} |
| 690 |
|
| 691 |
/* |
| 692 |
* @brief Calls to random boundary number generators for Sint16 |
| 693 |
*/ |
| 694 |
int sdltest_randomBoundaryNumberSint16(void *arg) |
| 695 |
{ |
| 696 |
const char *expectedError = "That operation is not supported"; |
| 697 |
char *lastError; |
| 698 |
Sint64 sresult; |
| 699 |
|
| 700 |
/* Clean error messages */ |
| 701 |
SDL_ClearError(); |
| 702 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 703 |
|
| 704 |
/* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 705 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 10, SDL_TRUE); |
| 706 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 707 |
SDLTest_AssertCheck( |
| 708 |
sresult == 10, |
| 709 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); |
| 710 |
|
| 711 |
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 712 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 11, SDL_TRUE); |
| 713 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 714 |
SDLTest_AssertCheck( |
| 715 |
sresult == 10 || sresult == 11, |
| 716 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); |
| 717 |
|
| 718 |
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 719 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 12, SDL_TRUE); |
| 720 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 721 |
SDLTest_AssertCheck( |
| 722 |
sresult == 10 || sresult == 11 || sresult == 12, |
| 723 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); |
| 724 |
|
| 725 |
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 726 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 13, SDL_TRUE); |
| 727 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 728 |
SDLTest_AssertCheck( |
| 729 |
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, |
| 730 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); |
| 731 |
|
| 732 |
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 733 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(10, 20, SDL_TRUE); |
| 734 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 735 |
SDLTest_AssertCheck( |
| 736 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 737 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 738 |
|
| 739 |
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 740 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(20, 10, SDL_TRUE); |
| 741 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 742 |
SDLTest_AssertCheck( |
| 743 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 744 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 745 |
|
| 746 |
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 747 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(1, 20, SDL_FALSE); |
| 748 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 749 |
SDLTest_AssertCheck( |
| 750 |
sresult == 0 || sresult == 21, |
| 751 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); |
| 752 |
|
| 753 |
/* RandomSintXBoundaryValue(SHRT_MIN, 99, SDL_FALSE) returns 100 */ |
| 754 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, 99, SDL_FALSE); |
| 755 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 756 |
SDLTest_AssertCheck( |
| 757 |
sresult == 100, |
| 758 |
"Validate result value for parameters (SHRT_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); |
| 759 |
|
| 760 |
/* RandomSintXBoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE) returns SHRT_MIN (no error) */ |
| 761 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN + 1, SHRT_MAX, SDL_FALSE); |
| 762 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 763 |
SDLTest_AssertCheck( |
| 764 |
sresult == SHRT_MIN, |
| 765 |
"Validate result value for parameters (SHRT_MIN+1,SHRT_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); |
| 766 |
lastError = (char *)SDL_GetError(); |
| 767 |
SDLTest_AssertPass("SDL_GetError()"); |
| 768 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 769 |
|
| 770 |
/* RandomSintXBoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE) returns SHRT_MAX (no error) */ |
| 771 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX - 1, SDL_FALSE); |
| 772 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 773 |
SDLTest_AssertCheck( |
| 774 |
sresult == SHRT_MAX, |
| 775 |
"Validate result value for parameters (SHRT_MIN,SHRT_MAX - 1,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MAX, 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, SDL_FALSE) returns 0 (sets error) */ |
| 781 |
sresult = (Sint64)SDLTest_RandomSint16BoundaryValue(SHRT_MIN, SHRT_MAX, SDL_FALSE); |
| 782 |
SDLTest_AssertPass("Call to SDLTest_RandomSint16BoundaryValue"); |
| 783 |
SDLTest_AssertCheck( |
| 784 |
sresult == SHRT_MIN, |
| 785 |
"Validate result value for parameters(SHRT_MIN,SHRT_MAX,SDL_FALSE); expected: %d, got: %" SDL_PRIs64, SHRT_MIN, sresult); |
| 786 |
lastError = (char *)SDL_GetError(); |
| 787 |
SDLTest_AssertPass("SDL_GetError()"); |
| 788 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 789 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 790 |
expectedError, |
| 791 |
lastError); |
| 792 |
|
| 793 |
/* Clear error messages */ |
| 794 |
SDL_ClearError(); |
| 795 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 796 |
|
| 797 |
return TEST_COMPLETED; |
| 798 |
} |
| 799 |
|
| 800 |
/* |
| 801 |
* @brief Calls to random boundary number generators for Sint32 |
| 802 |
*/ |
| 803 |
int sdltest_randomBoundaryNumberSint32(void *arg) |
| 804 |
{ |
| 805 |
const char *expectedError = "That operation is not supported"; |
| 806 |
char *lastError; |
| 807 |
Sint64 sresult; |
| 808 |
#if ((ULONG_MAX) == (UINT_MAX)) |
| 809 |
Sint32 long_min = LONG_MIN; |
| 810 |
Sint32 long_max = LONG_MAX; |
| 811 |
#else |
| 812 |
Sint32 long_min = INT_MIN; |
| 813 |
Sint32 long_max = INT_MAX; |
| 814 |
#endif |
| 815 |
|
| 816 |
/* Clean error messages */ |
| 817 |
SDL_ClearError(); |
| 818 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 819 |
|
| 820 |
/* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 821 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 10, SDL_TRUE); |
| 822 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 823 |
SDLTest_AssertCheck( |
| 824 |
sresult == 10, |
| 825 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); |
| 826 |
|
| 827 |
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 828 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 11, SDL_TRUE); |
| 829 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 830 |
SDLTest_AssertCheck( |
| 831 |
sresult == 10 || sresult == 11, |
| 832 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); |
| 833 |
|
| 834 |
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 835 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 12, SDL_TRUE); |
| 836 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 837 |
SDLTest_AssertCheck( |
| 838 |
sresult == 10 || sresult == 11 || sresult == 12, |
| 839 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); |
| 840 |
|
| 841 |
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 842 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 13, SDL_TRUE); |
| 843 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 844 |
SDLTest_AssertCheck( |
| 845 |
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, |
| 846 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); |
| 847 |
|
| 848 |
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 849 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(10, 20, SDL_TRUE); |
| 850 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 851 |
SDLTest_AssertCheck( |
| 852 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 853 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 854 |
|
| 855 |
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 856 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(20, 10, SDL_TRUE); |
| 857 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 858 |
SDLTest_AssertCheck( |
| 859 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 860 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 861 |
|
| 862 |
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 863 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(1, 20, SDL_FALSE); |
| 864 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 865 |
SDLTest_AssertCheck( |
| 866 |
sresult == 0 || sresult == 21, |
| 867 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); |
| 868 |
|
| 869 |
/* RandomSintXBoundaryValue(LONG_MIN, 99, SDL_FALSE) returns 100 */ |
| 870 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, 99, SDL_FALSE); |
| 871 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 872 |
SDLTest_AssertCheck( |
| 873 |
sresult == 100, |
| 874 |
"Validate result value for parameters (LONG_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); |
| 875 |
|
| 876 |
/* RandomSintXBoundaryValue(LONG_MIN + 1, LONG_MAX, SDL_FALSE) returns LONG_MIN (no error) */ |
| 877 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min + 1, long_max, SDL_FALSE); |
| 878 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 879 |
SDLTest_AssertCheck( |
| 880 |
sresult == long_min, |
| 881 |
"Validate result value for parameters (LONG_MIN+1,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); |
| 882 |
lastError = (char *)SDL_GetError(); |
| 883 |
SDLTest_AssertPass("SDL_GetError()"); |
| 884 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 885 |
|
| 886 |
/* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX - 1, SDL_FALSE) returns LONG_MAX (no error) */ |
| 887 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max - 1, SDL_FALSE); |
| 888 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 889 |
SDLTest_AssertCheck( |
| 890 |
sresult == long_max, |
| 891 |
"Validate result value for parameters (LONG_MIN,LONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_max, sresult); |
| 892 |
lastError = (char *)SDL_GetError(); |
| 893 |
SDLTest_AssertPass("SDL_GetError()"); |
| 894 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 895 |
|
| 896 |
/* RandomSintXBoundaryValue(LONG_MIN, LONG_MAX, SDL_FALSE) returns 0 (sets error) */ |
| 897 |
sresult = (Sint64)SDLTest_RandomSint32BoundaryValue(long_min, long_max, SDL_FALSE); |
| 898 |
SDLTest_AssertPass("Call to SDLTest_RandomSint32BoundaryValue"); |
| 899 |
SDLTest_AssertCheck( |
| 900 |
sresult == long_min, |
| 901 |
"Validate result value for parameters(LONG_MIN,LONG_MAX,SDL_FALSE); expected: %" SDL_PRIs32 ", got: %" SDL_PRIs64, long_min, sresult); |
| 902 |
lastError = (char *)SDL_GetError(); |
| 903 |
SDLTest_AssertPass("SDL_GetError()"); |
| 904 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 905 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 906 |
expectedError, |
| 907 |
lastError); |
| 908 |
|
| 909 |
/* Clear error messages */ |
| 910 |
SDL_ClearError(); |
| 911 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 912 |
|
| 913 |
return TEST_COMPLETED; |
| 914 |
} |
| 915 |
|
| 916 |
/* |
| 917 |
* @brief Calls to random boundary number generators for Sint64 |
| 918 |
*/ |
| 919 |
int sdltest_randomBoundaryNumberSint64(void *arg) |
| 920 |
{ |
| 921 |
const char *expectedError = "That operation is not supported"; |
| 922 |
char *lastError; |
| 923 |
Sint64 sresult; |
| 924 |
|
| 925 |
/* Clean error messages */ |
| 926 |
SDL_ClearError(); |
| 927 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 928 |
|
| 929 |
/* RandomSintXBoundaryValue(10, 10, SDL_TRUE) returns 10 */ |
| 930 |
sresult = SDLTest_RandomSint64BoundaryValue(10, 10, SDL_TRUE); |
| 931 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 932 |
SDLTest_AssertCheck( |
| 933 |
sresult == 10, |
| 934 |
"Validate result value for parameters (10,10,SDL_TRUE); expected: 10, got: %" SDL_PRIs64, sresult); |
| 935 |
|
| 936 |
/* RandomSintXBoundaryValue(10, 11, SDL_TRUE) returns 10, 11 */ |
| 937 |
sresult = SDLTest_RandomSint64BoundaryValue(10, 11, SDL_TRUE); |
| 938 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 939 |
SDLTest_AssertCheck( |
| 940 |
sresult == 10 || sresult == 11, |
| 941 |
"Validate result value for parameters (10,11,SDL_TRUE); expected: 10|11, got: %" SDL_PRIs64, sresult); |
| 942 |
|
| 943 |
/* RandomSintXBoundaryValue(10, 12, SDL_TRUE) returns 10, 11, 12 */ |
| 944 |
sresult = SDLTest_RandomSint64BoundaryValue(10, 12, SDL_TRUE); |
| 945 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 946 |
SDLTest_AssertCheck( |
| 947 |
sresult == 10 || sresult == 11 || sresult == 12, |
| 948 |
"Validate result value for parameters (10,12,SDL_TRUE); expected: 10|11|12, got: %" SDL_PRIs64, sresult); |
| 949 |
|
| 950 |
/* RandomSintXBoundaryValue(10, 13, SDL_TRUE) returns 10, 11, 12, 13 */ |
| 951 |
sresult = SDLTest_RandomSint64BoundaryValue(10, 13, SDL_TRUE); |
| 952 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 953 |
SDLTest_AssertCheck( |
| 954 |
sresult == 10 || sresult == 11 || sresult == 12 || sresult == 13, |
| 955 |
"Validate result value for parameters (10,13,SDL_TRUE); expected: 10|11|12|13, got: %" SDL_PRIs64, sresult); |
| 956 |
|
| 957 |
/* RandomSintXBoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 958 |
sresult = SDLTest_RandomSint64BoundaryValue(10, 20, SDL_TRUE); |
| 959 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 960 |
SDLTest_AssertCheck( |
| 961 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 962 |
"Validate result value for parameters (10,20,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 963 |
|
| 964 |
/* RandomSintXBoundaryValue(20, 10, SDL_TRUE) returns 10, 11, 19 or 20 */ |
| 965 |
sresult = SDLTest_RandomSint64BoundaryValue(20, 10, SDL_TRUE); |
| 966 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 967 |
SDLTest_AssertCheck( |
| 968 |
sresult == 10 || sresult == 11 || sresult == 19 || sresult == 20, |
| 969 |
"Validate result value for parameters (20,10,SDL_TRUE); expected: 10|11|19|20, got: %" SDL_PRIs64, sresult); |
| 970 |
|
| 971 |
/* RandomSintXBoundaryValue(1, 20, SDL_FALSE) returns 0, 21 */ |
| 972 |
sresult = SDLTest_RandomSint64BoundaryValue(1, 20, SDL_FALSE); |
| 973 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 974 |
SDLTest_AssertCheck( |
| 975 |
sresult == 0 || sresult == 21, |
| 976 |
"Validate result value for parameters (1,20,SDL_FALSE); expected: 0|21, got: %" SDL_PRIs64, sresult); |
| 977 |
|
| 978 |
/* RandomSintXBoundaryValue(LLONG_MIN, 99, SDL_FALSE) returns 100 */ |
| 979 |
sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, 99, SDL_FALSE); |
| 980 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 981 |
SDLTest_AssertCheck( |
| 982 |
sresult == 100, |
| 983 |
"Validate result value for parameters (LLONG_MIN,99,SDL_FALSE); expected: 100, got: %" SDL_PRIs64, sresult); |
| 984 |
|
| 985 |
/* RandomSintXBoundaryValue(LLONG_MIN + 1, LLONG_MAX, SDL_FALSE) returns LLONG_MIN (no error) */ |
| 986 |
sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN + 1, INT64_MAX, SDL_FALSE); |
| 987 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 988 |
SDLTest_AssertCheck( |
| 989 |
sresult == INT64_MIN, |
| 990 |
"Validate result value for parameters (LLONG_MIN+1,LLONG_MAX,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); |
| 991 |
lastError = (char *)SDL_GetError(); |
| 992 |
SDLTest_AssertPass("SDL_GetError()"); |
| 993 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 994 |
|
| 995 |
/* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX - 1, SDL_FALSE) returns LLONG_MAX (no error) */ |
| 996 |
sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX - 1, SDL_FALSE); |
| 997 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 998 |
SDLTest_AssertCheck( |
| 999 |
sresult == INT64_MAX, |
| 1000 |
"Validate result value for parameters (LLONG_MIN,LLONG_MAX - 1,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MAX, sresult); |
| 1001 |
lastError = (char *)SDL_GetError(); |
| 1002 |
SDLTest_AssertPass("SDL_GetError()"); |
| 1003 |
SDLTest_AssertCheck(lastError == NULL || lastError[0] == '\0', "Validate no error message was set"); |
| 1004 |
|
| 1005 |
/* RandomSintXBoundaryValue(LLONG_MIN, LLONG_MAX, SDL_FALSE) returns 0 (sets error) */ |
| 1006 |
sresult = SDLTest_RandomSint64BoundaryValue(INT64_MIN, INT64_MAX, SDL_FALSE); |
| 1007 |
SDLTest_AssertPass("Call to SDLTest_RandomSint64BoundaryValue"); |
| 1008 |
SDLTest_AssertCheck( |
| 1009 |
sresult == INT64_MIN, |
| 1010 |
"Validate result value for parameters(LLONG_MIN,LLONG_MAX,SDL_FALSE); expected: %" SDL_PRIs64 ", got: %" SDL_PRIs64, INT64_MIN, sresult); |
| 1011 |
lastError = (char *)SDL_GetError(); |
| 1012 |
SDLTest_AssertPass("SDL_GetError()"); |
| 1013 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 1014 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 1015 |
expectedError, |
| 1016 |
lastError); |
| 1017 |
|
| 1018 |
/* Clear error messages */ |
| 1019 |
SDL_ClearError(); |
| 1020 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 1021 |
|
| 1022 |
return TEST_COMPLETED; |
| 1023 |
} |
| 1024 |
|
| 1025 |
/** |
| 1026 |
* @brief Calls to SDLTest_RandomIntegerInRange |
| 1027 |
*/ |
| 1028 |
int sdltest_randomIntegerInRange(void *arg) |
| 1029 |
{ |
| 1030 |
Sint32 min, max; |
| 1031 |
Sint32 result; |
| 1032 |
#if ((ULONG_MAX) == (UINT_MAX)) |
| 1033 |
Sint32 long_min = LONG_MIN; |
| 1034 |
Sint32 long_max = LONG_MAX; |
| 1035 |
#else |
| 1036 |
Sint32 long_min = INT_MIN; |
| 1037 |
Sint32 long_max = INT_MAX; |
| 1038 |
#endif |
| 1039 |
|
| 1040 |
/* Standard range */ |
| 1041 |
min = (Sint32)SDLTest_RandomSint16(); |
| 1042 |
max = min + (Sint32)SDLTest_RandomUint8() + 2; |
| 1043 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1044 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,max)"); |
| 1045 |
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); |
| 1046 |
|
| 1047 |
/* One Range */ |
| 1048 |
min = (Sint32)SDLTest_RandomSint16(); |
| 1049 |
max = min + 1; |
| 1050 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1051 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min+1)"); |
| 1052 |
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); |
| 1053 |
|
| 1054 |
/* Zero range */ |
| 1055 |
min = (Sint32)SDLTest_RandomSint16(); |
| 1056 |
max = min; |
| 1057 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1058 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(min,min)"); |
| 1059 |
SDLTest_AssertCheck(min == result, "Validated returned value; expected: %" SDL_PRIs32 ", got: %" SDL_PRIs32, min, result); |
| 1060 |
|
| 1061 |
/* Zero range at zero */ |
| 1062 |
min = 0; |
| 1063 |
max = 0; |
| 1064 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1065 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(0,0)"); |
| 1066 |
SDLTest_AssertCheck(result == 0, "Validated returned value; expected: 0, got: %" SDL_PRIs32, result); |
| 1067 |
|
| 1068 |
/* Swapped min-max */ |
| 1069 |
min = (Sint32)SDLTest_RandomSint16(); |
| 1070 |
max = min + (Sint32)SDLTest_RandomUint8() + 2; |
| 1071 |
result = SDLTest_RandomIntegerInRange(max, min); |
| 1072 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(max,min)"); |
| 1073 |
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); |
| 1074 |
|
| 1075 |
/* Range with min at integer limit */ |
| 1076 |
min = long_min; |
| 1077 |
max = long_min + (Sint32)SDLTest_RandomUint16(); |
| 1078 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1079 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,...)"); |
| 1080 |
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); |
| 1081 |
|
| 1082 |
/* Range with max at integer limit */ |
| 1083 |
min = long_max - (Sint32)SDLTest_RandomUint16(); |
| 1084 |
max = long_max; |
| 1085 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1086 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(...,SINT32_MAX)"); |
| 1087 |
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); |
| 1088 |
|
| 1089 |
/* Full integer range */ |
| 1090 |
min = long_min; |
| 1091 |
max = long_max; |
| 1092 |
result = SDLTest_RandomIntegerInRange(min, max); |
| 1093 |
SDLTest_AssertPass("Call to SDLTest_RandomIntegerInRange(SINT32_MIN,SINT32_MAX)"); |
| 1094 |
SDLTest_AssertCheck(min <= result && result <= max, "Validated returned value; expected: [%" SDL_PRIs32 ",%" SDL_PRIs32 "], got: %" SDL_PRIs32, min, max, result); |
| 1095 |
|
| 1096 |
return TEST_COMPLETED; |
| 1097 |
} |
| 1098 |
|
| 1099 |
/** |
| 1100 |
* @brief Calls to SDLTest_RandomAsciiString |
| 1101 |
*/ |
| 1102 |
int sdltest_randomAsciiString(void *arg) |
| 1103 |
{ |
| 1104 |
char *result; |
| 1105 |
size_t len; |
| 1106 |
int nonAsciiCharacters; |
| 1107 |
size_t i; |
| 1108 |
|
| 1109 |
result = SDLTest_RandomAsciiString(); |
| 1110 |
SDLTest_AssertPass("Call to SDLTest_RandomAsciiString()"); |
| 1111 |
SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL"); |
| 1112 |
if (result != NULL) { |
| 1113 |
len = SDL_strlen(result); |
| 1114 |
SDLTest_AssertCheck(len >= 1 && len <= 255, "Validate that result length; expected: len=[1,255], got: %d", (int)len); |
| 1115 |
nonAsciiCharacters = 0; |
| 1116 |
for (i = 0; i < len; i++) { |
| 1117 |
if (SDL_iscntrl(result[i])) { |
| 1118 |
nonAsciiCharacters++; |
| 1119 |
} |
| 1120 |
} |
| 1121 |
SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); |
| 1122 |
if (nonAsciiCharacters) { |
| 1123 |
SDLTest_LogError("Invalid result from generator: '%s'", result); |
| 1124 |
} |
| 1125 |
SDL_free(result); |
| 1126 |
} |
| 1127 |
|
| 1128 |
return TEST_COMPLETED; |
| 1129 |
} |
| 1130 |
|
| 1131 |
/** |
| 1132 |
* @brief Calls to SDLTest_RandomAsciiStringWithMaximumLength |
| 1133 |
*/ |
| 1134 |
int sdltest_randomAsciiStringWithMaximumLength(void *arg) |
| 1135 |
{ |
| 1136 |
const char *expectedError = "Parameter 'maxLength' is invalid"; |
| 1137 |
char *lastError; |
| 1138 |
char *result; |
| 1139 |
size_t targetLen; |
| 1140 |
size_t len; |
| 1141 |
int nonAsciiCharacters; |
| 1142 |
size_t i; |
| 1143 |
|
| 1144 |
targetLen = 16 + SDLTest_RandomUint8(); |
| 1145 |
result = SDLTest_RandomAsciiStringWithMaximumLength((int)targetLen); |
| 1146 |
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", (int)targetLen); |
| 1147 |
SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL"); |
| 1148 |
if (result != NULL) { |
| 1149 |
len = SDL_strlen(result); |
| 1150 |
SDLTest_AssertCheck(len >= 1 && len <= targetLen, "Validate that result length; expected: len=[1,%d], got: %d", (int)targetLen, (int)len); |
| 1151 |
nonAsciiCharacters = 0; |
| 1152 |
for (i = 0; i < len; i++) { |
| 1153 |
if (SDL_iscntrl(result[i])) { |
| 1154 |
nonAsciiCharacters++; |
| 1155 |
} |
| 1156 |
} |
| 1157 |
SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-Ascii characters, got: %d", nonAsciiCharacters); |
| 1158 |
if (nonAsciiCharacters) { |
| 1159 |
SDLTest_LogError("Invalid result from generator: '%s'", result); |
| 1160 |
} |
| 1161 |
SDL_free(result); |
| 1162 |
} |
| 1163 |
|
| 1164 |
/* Negative test */ |
| 1165 |
targetLen = 0; |
| 1166 |
result = SDLTest_RandomAsciiStringWithMaximumLength((int)targetLen); |
| 1167 |
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringWithMaximumLength(%d)", (int)targetLen); |
| 1168 |
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); |
| 1169 |
lastError = (char *)SDL_GetError(); |
| 1170 |
SDLTest_AssertPass("SDL_GetError()"); |
| 1171 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 1172 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 1173 |
expectedError, |
| 1174 |
lastError); |
| 1175 |
|
| 1176 |
/* Clear error messages */ |
| 1177 |
SDL_ClearError(); |
| 1178 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 1179 |
|
| 1180 |
return TEST_COMPLETED; |
| 1181 |
} |
| 1182 |
|
| 1183 |
/** |
| 1184 |
* @brief Calls to SDLTest_RandomAsciiStringOfSize |
| 1185 |
*/ |
| 1186 |
int sdltest_randomAsciiStringOfSize(void *arg) |
| 1187 |
{ |
| 1188 |
const char *expectedError = "Parameter 'size' is invalid"; |
| 1189 |
char *lastError; |
| 1190 |
char *result; |
| 1191 |
size_t targetLen; |
| 1192 |
size_t len; |
| 1193 |
int nonAsciiCharacters; |
| 1194 |
size_t i; |
| 1195 |
|
| 1196 |
/* Positive test */ |
| 1197 |
targetLen = 16 + SDLTest_RandomUint8(); |
| 1198 |
result = SDLTest_RandomAsciiStringOfSize((int)targetLen); |
| 1199 |
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", (int)targetLen); |
| 1200 |
SDLTest_AssertCheck(result != NULL, "Validate that result is not NULL"); |
| 1201 |
if (result != NULL) { |
| 1202 |
len = SDL_strlen(result); |
| 1203 |
SDLTest_AssertCheck(len == targetLen, "Validate that result length; expected: len=%d, got: %d", (int)targetLen, (int)len); |
| 1204 |
nonAsciiCharacters = 0; |
| 1205 |
for (i = 0; i < len; i++) { |
| 1206 |
if (SDL_iscntrl(result[i])) { |
| 1207 |
nonAsciiCharacters++; |
| 1208 |
} |
| 1209 |
} |
| 1210 |
SDLTest_AssertCheck(nonAsciiCharacters == 0, "Validate that result does not contain non-ASCII characters, got: %d", nonAsciiCharacters); |
| 1211 |
if (nonAsciiCharacters) { |
| 1212 |
SDLTest_LogError("Invalid result from generator: '%s'", result); |
| 1213 |
} |
| 1214 |
SDL_free(result); |
| 1215 |
} |
| 1216 |
|
| 1217 |
/* Negative test */ |
| 1218 |
targetLen = 0; |
| 1219 |
result = SDLTest_RandomAsciiStringOfSize((int)targetLen); |
| 1220 |
SDLTest_AssertPass("Call to SDLTest_RandomAsciiStringOfSize(%d)", (int)targetLen); |
| 1221 |
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); |
| 1222 |
lastError = (char *)SDL_GetError(); |
| 1223 |
SDLTest_AssertPass("SDL_GetError()"); |
| 1224 |
SDLTest_AssertCheck(lastError != NULL && SDL_strcmp(lastError, expectedError) == 0, |
| 1225 |
"SDL_GetError(): expected message '%s', was message: '%s'", |
| 1226 |
expectedError, |
| 1227 |
lastError); |
| 1228 |
|
| 1229 |
/* Clear error messages */ |
| 1230 |
SDL_ClearError(); |
| 1231 |
SDLTest_AssertPass("SDL_ClearError()"); |
| 1232 |
|
| 1233 |
return TEST_COMPLETED; |
| 1234 |
} |
| 1235 |
|
| 1236 |
/* ================= Test References ================== */ |
| 1237 |
|
| 1238 |
/* SDL_test test cases */ |
| 1239 |
static const SDLTest_TestCaseReference sdltestTest1 = { |
| 1240 |
(SDLTest_TestCaseFp)sdltest_getFuzzerInvocationCount, "sdltest_getFuzzerInvocationCount", "Call to sdltest_GetFuzzerInvocationCount", TEST_ENABLED |
| 1241 |
}; |
| 1242 |
|
| 1243 |
static const SDLTest_TestCaseReference sdltestTest2 = { |
| 1244 |
(SDLTest_TestCaseFp)sdltest_randomNumber, "sdltest_randomNumber", "Calls to random number generators", TEST_ENABLED |
| 1245 |
}; |
| 1246 |
|
| 1247 |
static const SDLTest_TestCaseReference sdltestTest3 = { |
| 1248 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint8, "sdltest_randomBoundaryNumberUint8", "Calls to random boundary number generators for Uint8", TEST_ENABLED |
| 1249 |
}; |
| 1250 |
|
| 1251 |
static const SDLTest_TestCaseReference sdltestTest4 = { |
| 1252 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint16, "sdltest_randomBoundaryNumberUint16", "Calls to random boundary number generators for Uint16", TEST_ENABLED |
| 1253 |
}; |
| 1254 |
|
| 1255 |
static const SDLTest_TestCaseReference sdltestTest5 = { |
| 1256 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint32, "sdltest_randomBoundaryNumberUint32", "Calls to random boundary number generators for Uint32", TEST_ENABLED |
| 1257 |
}; |
| 1258 |
|
| 1259 |
static const SDLTest_TestCaseReference sdltestTest6 = { |
| 1260 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberUint64, "sdltest_randomBoundaryNumberUint64", "Calls to random boundary number generators for Uint64", TEST_ENABLED |
| 1261 |
}; |
| 1262 |
|
| 1263 |
static const SDLTest_TestCaseReference sdltestTest7 = { |
| 1264 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint8, "sdltest_randomBoundaryNumberSint8", "Calls to random boundary number generators for Sint8", TEST_ENABLED |
| 1265 |
}; |
| 1266 |
|
| 1267 |
static const SDLTest_TestCaseReference sdltestTest8 = { |
| 1268 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint16, "sdltest_randomBoundaryNumberSint16", "Calls to random boundary number generators for Sint16", TEST_ENABLED |
| 1269 |
}; |
| 1270 |
|
| 1271 |
static const SDLTest_TestCaseReference sdltestTest9 = { |
| 1272 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint32, "sdltest_randomBoundaryNumberSint32", "Calls to random boundary number generators for Sint32", TEST_ENABLED |
| 1273 |
}; |
| 1274 |
|
| 1275 |
static const SDLTest_TestCaseReference sdltestTest10 = { |
| 1276 |
(SDLTest_TestCaseFp)sdltest_randomBoundaryNumberSint64, "sdltest_randomBoundaryNumberSint64", "Calls to random boundary number generators for Sint64", TEST_ENABLED |
| 1277 |
}; |
| 1278 |
|
| 1279 |
static const SDLTest_TestCaseReference sdltestTest11 = { |
| 1280 |
(SDLTest_TestCaseFp)sdltest_randomIntegerInRange, "sdltest_randomIntegerInRange", "Calls to ranged random number generator", TEST_ENABLED |
| 1281 |
}; |
| 1282 |
|
| 1283 |
static const SDLTest_TestCaseReference sdltestTest12 = { |
| 1284 |
(SDLTest_TestCaseFp)sdltest_randomAsciiString, "sdltest_randomAsciiString", "Calls to default ASCII string generator", TEST_ENABLED |
| 1285 |
}; |
| 1286 |
|
| 1287 |
static const SDLTest_TestCaseReference sdltestTest13 = { |
| 1288 |
(SDLTest_TestCaseFp)sdltest_randomAsciiStringWithMaximumLength, "sdltest_randomAsciiStringWithMaximumLength", "Calls to random maximum length ASCII string generator", TEST_ENABLED |
| 1289 |
}; |
| 1290 |
|
| 1291 |
static const SDLTest_TestCaseReference sdltestTest14 = { |
| 1292 |
(SDLTest_TestCaseFp)sdltest_randomAsciiStringOfSize, "sdltest_randomAsciiStringOfSize", "Calls to fixed size ASCII string generator", TEST_ENABLED |
| 1293 |
}; |
| 1294 |
|
| 1295 |
static const SDLTest_TestCaseReference sdltestTest15 = { |
| 1296 |
(SDLTest_TestCaseFp)sdltest_generateRunSeed, "sdltest_generateRunSeed", "Checks internal harness function SDLTest_GenerateRunSeed", TEST_ENABLED |
| 1297 |
}; |
| 1298 |
|
| 1299 |
/* Sequence of SDL_test test cases */ |
| 1300 |
static const SDLTest_TestCaseReference *sdltestTests[] = { |
| 1301 |
&sdltestTest1, &sdltestTest2, &sdltestTest3, &sdltestTest4, &sdltestTest5, &sdltestTest6, |
| 1302 |
&sdltestTest7, &sdltestTest8, &sdltestTest9, &sdltestTest10, &sdltestTest11, &sdltestTest12, |
| 1303 |
&sdltestTest13, &sdltestTest14, &sdltestTest15, NULL |
| 1304 |
}; |
| 1305 |
|
| 1306 |
/* SDL_test test suite (global) */ |
| 1307 |
SDLTest_TestSuiteReference sdltestTestSuite = { |
| 1308 |
"SDLtest", |
| 1309 |
NULL, |
| 1310 |
sdltestTests, |
| 1311 |
NULL |
| 1312 |
}; |