SDL  2.0
testautomation_pixels.c File Reference
#include <stdio.h>
#include "SDL.h"
#include "SDL_test.h"
+ Include dependency graph for testautomation_pixels.c:

Go to the source code of this file.

Functions

int pixels_allocFreeFormat (void *arg)
 Call to SDL_AllocFormat and SDL_FreeFormat. More...
 
int pixels_getPixelFormatName (void *arg)
 Call to SDL_GetPixelFormatName. More...
 
int pixels_allocFreePalette (void *arg)
 Call to SDL_AllocPalette and SDL_FreePalette. More...
 
int pixels_calcGammaRamp (void *arg)
 Call to SDL_CalculateGammaRamp. More...
 

Variables

const int _numRGBPixelFormats = 31
 
Uint32 _RGBPixelFormats []
 
char * _RGBPixelFormatsVerbose []
 
const int _numNonRGBPixelFormats = 7
 
Uint32 _nonRGBPixelFormats []
 
char * _nonRGBPixelFormatsVerbose []
 
const int _numInvalidPixelFormats = 2
 
Uint32 _invalidPixelFormats []
 
char * _invalidPixelFormatsVerbose []
 
static const SDLTest_TestCaseReference pixelsTest1
 
static const SDLTest_TestCaseReference pixelsTest2
 
static const SDLTest_TestCaseReference pixelsTest3
 
static const SDLTest_TestCaseReference pixelsTest4
 
static const SDLTest_TestCaseReferencepixelsTests []
 
SDLTest_TestSuiteReference pixelsTestSuite
 

Function Documentation

◆ pixels_allocFreeFormat()

int pixels_allocFreeFormat ( void arg)

Call to SDL_AllocFormat and SDL_FreeFormat.

See also
http://wiki.libsdl.org/moin.fcg/SDL_AllocFormat
http://wiki.libsdl.org/moin.fcg/SDL_FreeFormat

Definition at line 128 of file testautomation_pixels.c.

129 {
130  const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
131  const char *expectedError = "Parameter 'format' is invalid";
132  const char *error;
133  int i;
134  Uint32 format;
135  Uint32 masks;
137 
138  /* Blank/unknown format */
139  format = 0;
140  SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
141 
142  /* Allocate format */
144  SDLTest_AssertPass("Call to SDL_AllocFormat()");
145  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
146  if (result != NULL) {
147  SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
148  SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel);
149  SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel);
150  masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
151  SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %u", masks);
152 
153  /* Deallocate again */
155  SDLTest_AssertPass("Call to SDL_FreeFormat()");
156  }
157 
158  /* RGB formats */
159  for (i = 0; i < _numRGBPixelFormats; i++) {
161  SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
162 
163  /* Allocate format */
165  SDLTest_AssertPass("Call to SDL_AllocFormat()");
166  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
167  if (result != NULL) {
168  SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
169  SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);
170  SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);
171  if (result->palette != NULL) {
172  masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
173  SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks);
174  }
175 
176  /* Deallocate again */
178  SDLTest_AssertPass("Call to SDL_FreeFormat()");
179  }
180  }
181 
182  /* Non-RGB formats */
183  for (i = 0; i < _numNonRGBPixelFormats; i++) {
185  SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
186 
187  /* Try to allocate format */
189  SDLTest_AssertPass("Call to SDL_AllocFormat()");
190  SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
191  }
192 
193  /* Negative cases */
194 
195  /* Invalid Formats */
196  for (i = 0; i < _numInvalidPixelFormats; i++) {
197  SDL_ClearError();
198  SDLTest_AssertPass("Call to SDL_ClearError()");
201  SDLTest_AssertPass("Call to SDL_AllocFormat(%u)", format);
202  SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
203  error = SDL_GetError();
204  SDLTest_AssertPass("Call to SDL_GetError()");
205  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
206  if (error != NULL) {
207  SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
208  "Validate error message, expected: '%s', got: '%s'", expectedError, error);
209  }
210  }
211 
212  /* Invalid free pointer */
213  SDL_ClearError();
214  SDLTest_AssertPass("Call to SDL_ClearError()");
216  SDLTest_AssertPass("Call to SDL_FreeFormat(NULL)");
217  error = SDL_GetError();
218  SDLTest_AssertPass("Call to SDL_GetError()");
219  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
220  if (error != NULL) {
221  SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
222  "Validate error message, expected: '%s', got: '%s'", expectedError, error);
223  }
224 
225  return TEST_COMPLETED;
226 }

References _invalidPixelFormats, _nonRGBPixelFormats, _nonRGBPixelFormatsVerbose, _numInvalidPixelFormats, _numNonRGBPixelFormats, _numRGBPixelFormats, _RGBPixelFormats, _RGBPixelFormatsVerbose, i, NULL, SDL_AllocFormat, SDL_ClearError, SDL_FreeFormat, SDL_GetError, SDL_strcmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_Log(), and TEST_COMPLETED.

◆ pixels_allocFreePalette()

int pixels_allocFreePalette ( void arg)

Call to SDL_AllocPalette and SDL_FreePalette.

See also
http://wiki.libsdl.org/moin.fcg/SDL_AllocPalette
http://wiki.libsdl.org/moin.fcg/SDL_FreePalette

Definition at line 319 of file testautomation_pixels.c.

320 {
321  const char *expectedError1 = "Parameter 'ncolors' is invalid";
322  const char *expectedError2 = "Parameter 'palette' is invalid";
323  const char *error;
324  int variation;
325  int i;
326  int ncolors;
328 
329  /* Allocate palette */
330  for (variation = 1; variation <= 3; variation++) {
331  switch (variation) {
332  /* Just one color */
333  case 1:
334  ncolors = 1;
335  break;
336  /* Two colors */
337  case 2:
338  ncolors = 2;
339  break;
340  /* More than two colors */
341  case 3:
342  ncolors = SDLTest_RandomIntegerInRange(8, 16);
343  break;
344  }
345 
346  result = SDL_AllocPalette(ncolors);
347  SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors);
348  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
349  if (result != NULL) {
350  SDLTest_AssertCheck(result->ncolors == ncolors, "Verify value of result.ncolors; expected: %u, got %u", ncolors, result->ncolors);
351  if (result->ncolors > 0) {
352  SDLTest_AssertCheck(result->colors != NULL, "Verify value of result.colors is not NULL");
353  if (result->colors != NULL) {
354  for(i = 0; i < result->ncolors; i++) {
355  SDLTest_AssertCheck(result->colors[i].r == 255, "Verify value of result.colors[%d].r; expected: 255, got %u", i, result->colors[i].r);
356  SDLTest_AssertCheck(result->colors[i].g == 255, "Verify value of result.colors[%d].g; expected: 255, got %u", i, result->colors[i].g);
357  SDLTest_AssertCheck(result->colors[i].b == 255, "Verify value of result.colors[%d].b; expected: 255, got %u", i, result->colors[i].b);
358  }
359  }
360  }
361 
362  /* Deallocate again */
364  SDLTest_AssertPass("Call to SDL_FreePalette()");
365  }
366  }
367 
368  /* Negative cases */
369 
370  /* Invalid number of colors */
371  for (ncolors = 0; ncolors > -3; ncolors--) {
372  SDL_ClearError();
373  SDLTest_AssertPass("Call to SDL_ClearError()");
374  result = SDL_AllocPalette(ncolors);
375  SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors);
376  SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
377  error = SDL_GetError();
378  SDLTest_AssertPass("Call to SDL_GetError()");
379  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
380  if (error != NULL) {
381  SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0,
382  "Validate error message, expected: '%s', got: '%s'", expectedError1, error);
383  }
384  }
385 
386  /* Invalid free pointer */
387  SDL_ClearError();
388  SDLTest_AssertPass("Call to SDL_ClearError()");
390  SDLTest_AssertPass("Call to SDL_FreePalette(NULL)");
391  error = SDL_GetError();
392  SDLTest_AssertPass("Call to SDL_GetError()");
393  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
394  if (error != NULL) {
395  SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
396  "Validate error message, expected: '%s', got: '%s'", expectedError2, error);
397  }
398 
399  return TEST_COMPLETED;
400 }

References i, NULL, SDL_AllocPalette, SDL_ClearError, SDL_FreePalette, SDL_GetError, SDL_strcmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), and TEST_COMPLETED.

◆ pixels_calcGammaRamp()

int pixels_calcGammaRamp ( void arg)

Call to SDL_CalculateGammaRamp.

See also
http://wiki.libsdl.org/moin.fcg/SDL_CalculateGammaRamp

Definition at line 408 of file testautomation_pixels.c.

409 {
410  const char *expectedError1 = "Parameter 'gamma' is invalid";
411  const char *expectedError2 = "Parameter 'ramp' is invalid";
412  const char *error;
413  float gamma;
414  Uint16 *ramp;
415  int variation;
416  int i;
417  int changed;
418  Uint16 magic = 0xbeef;
419 
420  /* Allocate temp ramp array and fill with some value */
421  ramp = (Uint16 *)SDL_malloc(256 * sizeof(Uint16));
422  SDLTest_AssertCheck(ramp != NULL, "Validate temp ramp array could be allocated");
423  if (ramp == NULL) return TEST_ABORTED;
424 
425  /* Make call with different gamma values */
426  for (variation = 0; variation < 4; variation++) {
427  switch (variation) {
428  /* gamma = 0 all black */
429  case 0:
430  gamma = 0.0f;
431  break;
432  /* gamma = 1 identity */
433  case 1:
434  gamma = 1.0f;
435  break;
436  /* gamma = [0.2,0.8] normal range */
437  case 2:
438  gamma = 0.2f + 0.8f * SDLTest_RandomUnitFloat();
439  break;
440  /* gamma = >1.1 non-standard range */
441  case 3:
442  gamma = 1.1f + SDLTest_RandomUnitFloat();
443  break;
444  }
445 
446  /* Make call and check that values were updated */
447  for (i = 0; i < 256; i++) ramp[i] = magic;
448  SDL_CalculateGammaRamp(gamma, ramp);
449  SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma);
450  changed = 0;
451  for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++;
452  SDLTest_AssertCheck(changed > 250, "Validate that ramp was calculated; expected: >250 values changed, got: %d values changed", changed);
453 
454  /* Additional value checks for some cases */
456  switch (variation) {
457  case 0:
458  SDLTest_AssertCheck(ramp[i] == 0, "Validate value at position %d; expected: 0, got: %d", i, ramp[i]);
459  break;
460  case 1:
461  SDLTest_AssertCheck(ramp[i] == ((i << 8) | i), "Validate value at position %d; expected: %d, got: %d", i, (i << 8) | i, ramp[i]);
462  break;
463  case 2:
464  case 3:
465  SDLTest_AssertCheck(ramp[i] > 0, "Validate value at position %d; expected: >0, got: %d", i, ramp[i]);
466  break;
467  }
468  }
469 
470  /* Negative cases */
471  SDL_ClearError();
472  SDLTest_AssertPass("Call to SDL_ClearError()");
473  gamma = -1;
474  for (i=0; i<256; i++) ramp[i] = magic;
475  SDL_CalculateGammaRamp(gamma, ramp);
476  SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma);
477  error = SDL_GetError();
478  SDLTest_AssertPass("Call to SDL_GetError()");
479  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
480  if (error != NULL) {
481  SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0,
482  "Validate error message, expected: '%s', got: '%s'", expectedError1, error);
483  }
484  changed = 0;
485  for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++;
486  SDLTest_AssertCheck(changed ==0, "Validate that ramp unchanged; expected: 0 values changed got: %d values changed", changed);
487 
489  SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(0.5,NULL)");
490  error = SDL_GetError();
491  SDLTest_AssertPass("Call to SDL_GetError()");
492  SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
493  if (error != NULL) {
494  SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
495  "Validate error message, expected: '%s', got: '%s'", expectedError2, error);
496  }
497 
498  /* Cleanup */
499  SDL_free(ramp);
500 
501 
502  return TEST_COMPLETED;
503 }

References i, NULL, SDL_CalculateGammaRamp, SDL_ClearError, SDL_free, SDL_GetError, SDL_malloc, SDL_strcmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_RandomIntegerInRange(), SDLTest_RandomUnitFloat(), TEST_ABORTED, and TEST_COMPLETED.

◆ pixels_getPixelFormatName()

int pixels_getPixelFormatName ( void arg)

Call to SDL_GetPixelFormatName.

See also
http://wiki.libsdl.org/moin.fcg/SDL_GetPixelFormatName

Definition at line 234 of file testautomation_pixels.c.

235 {
236  const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
237  const char *error;
238  int i;
239  Uint32 format;
240  char* result;
241 
242  /* Blank/undefined format */
243  format = 0;
244  SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
245 
246  /* Get name of format */
248  SDLTest_AssertPass("Call to SDL_GetPixelFormatName()");
249  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
250  if (result != NULL) {
251  SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
252  SDLTest_AssertCheck(SDL_strcmp(result, unknownFormat) == 0,
253  "Verify result text; expected: %s, got %s", unknownFormat, result);
254  }
255 
256  /* RGB formats */
257  for (i = 0; i < _numRGBPixelFormats; i++) {
259  SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
260 
261  /* Get name of format */
263  SDLTest_AssertPass("Call to SDL_GetPixelFormatName()");
264  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
265  if (result != NULL) {
266  SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
268  "Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result);
269  }
270  }
271 
272  /* Non-RGB formats */
273  for (i = 0; i < _numNonRGBPixelFormats; i++) {
275  SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
276 
277  /* Get name of format */
279  SDLTest_AssertPass("Call to SDL_GetPixelFormatName()");
280  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
281  if (result != NULL) {
282  SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
284  "Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result);
285  }
286  }
287 
288  /* Negative cases */
289 
290  /* Invalid Formats */
291  SDL_ClearError();
292  SDLTest_AssertPass("Call to SDL_ClearError()");
293  for (i = 0; i < _numInvalidPixelFormats; i++) {
296  SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%u)", format);
297  SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
298  if (result != NULL) {
299  SDLTest_AssertCheck(result[0] != '\0',
300  "Verify result is non-empty; got: %s", result);
302  "Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result);
303  }
304  error = SDL_GetError();
305  SDLTest_AssertPass("Call to SDL_GetError()");
306  SDLTest_AssertCheck(error == NULL || error[0] == '\0', "Validate that error message is empty");
307  }
308 
309  return TEST_COMPLETED;
310 }

References _invalidPixelFormats, _invalidPixelFormatsVerbose, _nonRGBPixelFormats, _nonRGBPixelFormatsVerbose, _numInvalidPixelFormats, _numNonRGBPixelFormats, _numRGBPixelFormats, _RGBPixelFormats, _RGBPixelFormatsVerbose, i, NULL, SDL_ClearError, SDL_GetError, SDL_GetPixelFormatName, SDL_strcmp, SDLTest_AssertCheck(), SDLTest_AssertPass(), SDLTest_Log(), and TEST_COMPLETED.

Variable Documentation

◆ _invalidPixelFormats

Uint32 _invalidPixelFormats[]
Initial value:
=
{
0xfffffffe,
0xffffffff
}

Definition at line 108 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ _invalidPixelFormatsVerbose

char* _invalidPixelFormatsVerbose[]
Initial value:
=
{
"SDL_PIXELFORMAT_UNKNOWN",
"SDL_PIXELFORMAT_UNKNOWN"
}

Definition at line 113 of file testautomation_pixels.c.

Referenced by pixels_getPixelFormatName().

◆ _nonRGBPixelFormats

◆ _nonRGBPixelFormatsVerbose

char* _nonRGBPixelFormatsVerbose[]
Initial value:
=
{
"SDL_PIXELFORMAT_YV12",
"SDL_PIXELFORMAT_IYUV",
"SDL_PIXELFORMAT_YUY2",
"SDL_PIXELFORMAT_UYVY",
"SDL_PIXELFORMAT_YVYU",
"SDL_PIXELFORMAT_NV12",
"SDL_PIXELFORMAT_NV21"
}

Definition at line 95 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ _numInvalidPixelFormats

const int _numInvalidPixelFormats = 2

Definition at line 107 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ _numNonRGBPixelFormats

const int _numNonRGBPixelFormats = 7

Definition at line 84 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ _numRGBPixelFormats

const int _numRGBPixelFormats = 31

Pixels test suite

Definition at line 13 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ _RGBPixelFormats

Uint32 _RGBPixelFormats[]

Definition at line 14 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ _RGBPixelFormatsVerbose

char* _RGBPixelFormatsVerbose[]

Definition at line 48 of file testautomation_pixels.c.

Referenced by pixels_allocFreeFormat(), and pixels_getPixelFormatName().

◆ pixelsTest1

const SDLTest_TestCaseReference pixelsTest1
static
Initial value:
=
{ (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED }

Definition at line 508 of file testautomation_pixels.c.

◆ pixelsTest2

const SDLTest_TestCaseReference pixelsTest2
static
Initial value:
=
{ (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED }

Definition at line 511 of file testautomation_pixels.c.

◆ pixelsTest3

const SDLTest_TestCaseReference pixelsTest3
static
Initial value:
=
{ (SDLTest_TestCaseFp)pixels_calcGammaRamp, "pixels_calcGammaRamp", "Call to SDL_CalculateGammaRamp", TEST_ENABLED }

Definition at line 514 of file testautomation_pixels.c.

◆ pixelsTest4

const SDLTest_TestCaseReference pixelsTest4
static
Initial value:
=
{ (SDLTest_TestCaseFp)pixels_getPixelFormatName, "pixels_getPixelFormatName", "Call to SDL_GetPixelFormatName", TEST_ENABLED }

Definition at line 517 of file testautomation_pixels.c.

◆ pixelsTests

const SDLTest_TestCaseReference* pixelsTests[]
static
Initial value:

Definition at line 521 of file testautomation_pixels.c.

◆ pixelsTestSuite

SDLTest_TestSuiteReference pixelsTestSuite
Initial value:
= {
"Pixels",
}

Definition at line 526 of file testautomation_pixels.c.

format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
SDL_GetError
#define SDL_GetError
Definition: SDL_dynapi_overrides.h:113
pixels_getPixelFormatName
int pixels_getPixelFormatName(void *arg)
Call to SDL_GetPixelFormatName.
Definition: testautomation_pixels.c:234
_numRGBPixelFormats
const int _numRGBPixelFormats
Definition: testautomation_pixels.c:13
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_GetPixelFormatName
#define SDL_GetPixelFormatName
Definition: SDL_dynapi_overrides.h:277
SDL_ClearError
#define SDL_ClearError
Definition: SDL_dynapi_overrides.h:114
SDL_PIXELFORMAT_NV21
@ SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:292
SDL_PIXELFORMAT_UYVY
@ SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:286
NULL
#define NULL
Definition: begin_code.h:167
_numNonRGBPixelFormats
const int _numNonRGBPixelFormats
Definition: testautomation_pixels.c:84
pixels_allocFreeFormat
int pixels_allocFreeFormat(void *arg)
Call to SDL_AllocFormat and SDL_FreeFormat.
Definition: testautomation_pixels.c:128
SDL_PIXELFORMAT_YUY2
@ SDL_PIXELFORMAT_YUY2
Definition: SDL_pixels.h:284
SDLTest_Log
void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and INFO priority.
Definition: SDL_test_log.c:85
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
_invalidPixelFormatsVerbose
char * _invalidPixelFormatsVerbose[]
Definition: testautomation_pixels.c:113
pixelsTest4
static const SDLTest_TestCaseReference pixelsTest4
Definition: testautomation_pixels.c:517
pixelsTests
static const SDLTest_TestCaseReference * pixelsTests[]
Definition: testautomation_pixels.c:521
_nonRGBPixelFormats
Uint32 _nonRGBPixelFormats[]
Definition: testautomation_pixels.c:85
result
GLuint64EXT * result
Definition: SDL_opengl_glext.h:9435
SDL_PIXELFORMAT_IYUV
@ SDL_PIXELFORMAT_IYUV
Definition: SDL_pixels.h:282
SDL_AllocFormat
#define SDL_AllocFormat
Definition: SDL_dynapi_overrides.h:280
_nonRGBPixelFormatsVerbose
char * _nonRGBPixelFormatsVerbose[]
Definition: testautomation_pixels.c:95
SDL_PIXELFORMAT_YVYU
@ SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:288
_invalidPixelFormats
Uint32 _invalidPixelFormats[]
Definition: testautomation_pixels.c:108
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition: SDL_test_harness.h:67
SDLTest_AssertPass
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.
Definition: SDL_test_assert.c:94
SDL_free
#define SDL_free
Definition: SDL_dynapi_overrides.h:377
pixelsTest1
static const SDLTest_TestCaseReference pixelsTest1
Definition: testautomation_pixels.c:508
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
TEST_ABORTED
#define TEST_ABORTED
Definition: SDL_test_harness.h:51
_numInvalidPixelFormats
const int _numInvalidPixelFormats
Definition: testautomation_pixels.c:107
_RGBPixelFormats
Uint32 _RGBPixelFormats[]
Definition: testautomation_pixels.c:14
pixels_calcGammaRamp
int pixels_calcGammaRamp(void *arg)
Call to SDL_CalculateGammaRamp.
Definition: testautomation_pixels.c:408
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
SDLTest_AssertCheck
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...
Definition: SDL_test_assert.c:65
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_FreeFormat
#define SDL_FreeFormat
Definition: SDL_dynapi_overrides.h:281
SDL_PixelFormat
Definition: SDL_pixels.h:318
pixelsTest2
static const SDLTest_TestCaseReference pixelsTest2
Definition: testautomation_pixels.c:511
SDL_FreePalette
#define SDL_FreePalette
Definition: SDL_dynapi_overrides.h:285
pixels_allocFreePalette
int pixels_allocFreePalette(void *arg)
Call to SDL_AllocPalette and SDL_FreePalette.
Definition: testautomation_pixels.c:319
SDL_AllocPalette
#define SDL_AllocPalette
Definition: SDL_dynapi_overrides.h:282
_RGBPixelFormatsVerbose
char * _RGBPixelFormatsVerbose[]
Definition: testautomation_pixels.c:48
SDL_Palette
Definition: SDL_pixels.h:307
SDL_PIXELFORMAT_NV12
@ SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:290
pixelsTest3
static const SDLTest_TestCaseReference pixelsTest3
Definition: testautomation_pixels.c:514
SDLTest_RandomUnitFloat
float SDLTest_RandomUnitFloat(void)
Definition: SDL_test_fuzzer.c:452
SDL_CalculateGammaRamp
#define SDL_CalculateGammaRamp
Definition: SDL_dynapi_overrides.h:290
SDL_malloc
#define SDL_malloc
Definition: SDL_dynapi_overrides.h:374
SDL_strcmp
#define SDL_strcmp
Definition: SDL_dynapi_overrides.h:417
SDL_PIXELFORMAT_YV12
@ SDL_PIXELFORMAT_YV12
Definition: SDL_pixels.h:280
i
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
SDLTest_RandomIntegerInRange
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
Definition: SDL_test_fuzzer.c:163