SDL  2.0
testautomation_pixels.c
Go to the documentation of this file.
1 /**
2  * Pixels test suite
3  */
4 
5 #include <stdio.h>
6 
7 #include "SDL.h"
8 #include "SDL_test.h"
9 
10 /* Test case functions */
11 
12 /* Definition of all RGB formats used to test pixel conversions */
13 const int _numRGBPixelFormats = 31;
15  {
47  };
49  {
50  "SDL_PIXELFORMAT_INDEX1LSB",
51  "SDL_PIXELFORMAT_INDEX1MSB",
52  "SDL_PIXELFORMAT_INDEX4LSB",
53  "SDL_PIXELFORMAT_INDEX4MSB",
54  "SDL_PIXELFORMAT_INDEX8",
55  "SDL_PIXELFORMAT_RGB332",
56  "SDL_PIXELFORMAT_RGB444",
57  "SDL_PIXELFORMAT_BGR444",
58  "SDL_PIXELFORMAT_RGB555",
59  "SDL_PIXELFORMAT_BGR555",
60  "SDL_PIXELFORMAT_ARGB4444",
61  "SDL_PIXELFORMAT_RGBA4444",
62  "SDL_PIXELFORMAT_ABGR4444",
63  "SDL_PIXELFORMAT_BGRA4444",
64  "SDL_PIXELFORMAT_ARGB1555",
65  "SDL_PIXELFORMAT_RGBA5551",
66  "SDL_PIXELFORMAT_ABGR1555",
67  "SDL_PIXELFORMAT_BGRA5551",
68  "SDL_PIXELFORMAT_RGB565",
69  "SDL_PIXELFORMAT_BGR565",
70  "SDL_PIXELFORMAT_RGB24",
71  "SDL_PIXELFORMAT_BGR24",
72  "SDL_PIXELFORMAT_RGB888",
73  "SDL_PIXELFORMAT_RGBX8888",
74  "SDL_PIXELFORMAT_BGR888",
75  "SDL_PIXELFORMAT_BGRX8888",
76  "SDL_PIXELFORMAT_ARGB8888",
77  "SDL_PIXELFORMAT_RGBA8888",
78  "SDL_PIXELFORMAT_ABGR8888",
79  "SDL_PIXELFORMAT_BGRA8888",
80  "SDL_PIXELFORMAT_ARGB2101010"
81  };
82 
83 /* Definition of all Non-RGB formats used to test pixel conversions */
84 const int _numNonRGBPixelFormats = 7;
86  {
94  };
96  {
97  "SDL_PIXELFORMAT_YV12",
98  "SDL_PIXELFORMAT_IYUV",
99  "SDL_PIXELFORMAT_YUY2",
100  "SDL_PIXELFORMAT_UYVY",
101  "SDL_PIXELFORMAT_YVYU",
102  "SDL_PIXELFORMAT_NV12",
103  "SDL_PIXELFORMAT_NV21"
104  };
105 
106 /* Definition of some invalid formats for negative tests */
109  {
110  0xfffffffe,
111  0xffffffff
112  };
114  {
115  "SDL_PIXELFORMAT_UNKNOWN",
116  "SDL_PIXELFORMAT_UNKNOWN"
117  };
118 
119 /* Test case functions */
120 
121 /**
122  * @brief Call to SDL_AllocFormat and SDL_FreeFormat
123  *
124  * @sa http://wiki.libsdl.org/moin.fcg/SDL_AllocFormat
125  * @sa http://wiki.libsdl.org/moin.fcg/SDL_FreeFormat
126  */
127 int
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 }
227 
228 /**
229  * @brief Call to SDL_GetPixelFormatName
230  *
231  * @sa http://wiki.libsdl.org/moin.fcg/SDL_GetPixelFormatName
232  */
233 int
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 }
311 
312 /**
313  * @brief Call to SDL_AllocPalette and SDL_FreePalette
314  *
315  * @sa http://wiki.libsdl.org/moin.fcg/SDL_AllocPalette
316  * @sa http://wiki.libsdl.org/moin.fcg/SDL_FreePalette
317  */
318 int
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 }
401 
402 /**
403  * @brief Call to SDL_CalculateGammaRamp
404  *
405  * @sa http://wiki.libsdl.org/moin.fcg/SDL_CalculateGammaRamp
406  */
407 int
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 }
504 
505 /* ================= Test References ================== */
506 
507 /* Pixels test cases */
509  { (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED };
510 
512  { (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED };
513 
515  { (SDLTest_TestCaseFp)pixels_calcGammaRamp, "pixels_calcGammaRamp", "Call to SDL_CalculateGammaRamp", TEST_ENABLED };
516 
518  { (SDLTest_TestCaseFp)pixels_getPixelFormatName, "pixels_getPixelFormatName", "Call to SDL_GetPixelFormatName", TEST_ENABLED };
519 
520 /* Sequence of Pixels test cases */
523 };
524 
525 /* Pixels test suite (global) */
527  "Pixels",
528  NULL,
529  pixelsTests,
530  NULL
531 };
SDL.h
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
SDL_PIXELFORMAT_ARGB1555
@ SDL_PIXELFORMAT_ARGB1555
Definition: SDL_pixels.h:215
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
SDL_PIXELFORMAT_BGRA4444
@ SDL_PIXELFORMAT_BGRA4444
Definition: SDL_pixels.h:212
SDL_GetPixelFormatName
#define SDL_GetPixelFormatName
Definition: SDL_dynapi_overrides.h:277
Uint16
uint16_t Uint16
Definition: SDL_stdinc.h:191
SDL_ClearError
#define SDL_ClearError
Definition: SDL_dynapi_overrides.h:114
SDL_PIXELFORMAT_INDEX1LSB
@ SDL_PIXELFORMAT_INDEX1LSB
Definition: SDL_pixels.h:174
SDL_PIXELFORMAT_RGB888
@ SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:239
SDL_test.h
SDL_PIXELFORMAT_NV21
@ SDL_PIXELFORMAT_NV21
Definition: SDL_pixels.h:292
SDL_PIXELFORMAT_UYVY
@ SDL_PIXELFORMAT_UYVY
Definition: SDL_pixels.h:286
SDL_PIXELFORMAT_RGBX8888
@ SDL_PIXELFORMAT_RGBX8888
Definition: SDL_pixels.h:242
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
SDL_PIXELFORMAT_BGR888
@ SDL_PIXELFORMAT_BGR888
Definition: SDL_pixels.h:245
SDL_PIXELFORMAT_BGR565
@ SDL_PIXELFORMAT_BGR565
Definition: SDL_pixels.h:230
TEST_ENABLED
#define TEST_ENABLED
Definition: SDL_test_harness.h:47
_invalidPixelFormatsVerbose
char * _invalidPixelFormatsVerbose[]
Definition: testautomation_pixels.c:113
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_PIXELFORMAT_RGB565
@ SDL_PIXELFORMAT_RGB565
Definition: SDL_pixels.h:227
pixelsTest4
static const SDLTest_TestCaseReference pixelsTest4
Definition: testautomation_pixels.c:517
pixelsTests
static const SDLTest_TestCaseReference * pixelsTests[]
Definition: testautomation_pixels.c:521
SDL_PIXELFORMAT_BGRX8888
@ SDL_PIXELFORMAT_BGRX8888
Definition: SDL_pixels.h:248
_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
pixelsTestSuite
SDLTest_TestSuiteReference pixelsTestSuite
Definition: testautomation_pixels.c:526
SDL_PIXELFORMAT_RGB332
@ SDL_PIXELFORMAT_RGB332
Definition: SDL_pixels.h:188
SDL_PIXELFORMAT_BGR555
@ SDL_PIXELFORMAT_BGR555
Definition: SDL_pixels.h:200
SDL_PIXELFORMAT_YVYU
@ SDL_PIXELFORMAT_YVYU
Definition: SDL_pixels.h:288
SDL_PIXELFORMAT_ARGB4444
@ SDL_PIXELFORMAT_ARGB4444
Definition: SDL_pixels.h:203
SDL_PIXELFORMAT_RGBA5551
@ SDL_PIXELFORMAT_RGBA5551
Definition: SDL_pixels.h:218
_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
SDL_PIXELFORMAT_RGB444
@ SDL_PIXELFORMAT_RGB444
Definition: SDL_pixels.h:191
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
SDL_PIXELFORMAT_BGR444
@ SDL_PIXELFORMAT_BGR444
Definition: SDL_pixels.h:194
SDL_PIXELFORMAT_ARGB2101010
@ SDL_PIXELFORMAT_ARGB2101010
Definition: SDL_pixels.h:263
_numInvalidPixelFormats
const int _numInvalidPixelFormats
Definition: testautomation_pixels.c:107
_RGBPixelFormats
Uint32 _RGBPixelFormats[]
Definition: testautomation_pixels.c:14
SDL_PIXELFORMAT_ABGR1555
@ SDL_PIXELFORMAT_ABGR1555
Definition: SDL_pixels.h:221
pixels_calcGammaRamp
int pixels_calcGammaRamp(void *arg)
Call to SDL_CalculateGammaRamp.
Definition: testautomation_pixels.c:408
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
SDLTest_TestCaseReference
Definition: SDL_test_harness.h:75
TEST_COMPLETED
#define TEST_COMPLETED
Definition: SDL_test_harness.h:53
SDL_FreeFormat
#define SDL_FreeFormat
Definition: SDL_dynapi_overrides.h:281
SDL_PIXELFORMAT_ABGR4444
@ SDL_PIXELFORMAT_ABGR4444
Definition: SDL_pixels.h:209
SDL_PIXELFORMAT_ARGB8888
@ SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:251
SDL_PixelFormat
Definition: SDL_pixels.h:319
pixelsTest2
static const SDLTest_TestCaseReference pixelsTest2
Definition: testautomation_pixels.c:511
SDL_PIXELFORMAT_RGBA4444
@ SDL_PIXELFORMAT_RGBA4444
Definition: SDL_pixels.h:206
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
SDL_PIXELFORMAT_INDEX1MSB
@ SDL_PIXELFORMAT_INDEX1MSB
Definition: SDL_pixels.h:177
SDL_PIXELFORMAT_RGB555
@ SDL_PIXELFORMAT_RGB555
Definition: SDL_pixels.h:197
_RGBPixelFormatsVerbose
char * _RGBPixelFormatsVerbose[]
Definition: testautomation_pixels.c:48
SDL_Palette
Definition: SDL_pixels.h:308
SDL_PIXELFORMAT_INDEX4LSB
@ SDL_PIXELFORMAT_INDEX4LSB
Definition: SDL_pixels.h:180
SDL_PIXELFORMAT_RGBA8888
@ SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:254
SDL_PIXELFORMAT_RGB24
@ SDL_PIXELFORMAT_RGB24
Definition: SDL_pixels.h:233
SDL_PIXELFORMAT_NV12
@ SDL_PIXELFORMAT_NV12
Definition: SDL_pixels.h:290
SDL_PIXELFORMAT_BGRA5551
@ SDL_PIXELFORMAT_BGRA5551
Definition: SDL_pixels.h:224
SDL_PIXELFORMAT_BGRA8888
@ SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:260
pixelsTest3
static const SDLTest_TestCaseReference pixelsTest3
Definition: testautomation_pixels.c:514
SDL_PIXELFORMAT_BGR24
@ SDL_PIXELFORMAT_BGR24
Definition: SDL_pixels.h:236
SDLTest_RandomUnitFloat
float SDLTest_RandomUnitFloat(void)
Definition: SDL_test_fuzzer.c:452
SDL_PIXELFORMAT_INDEX4MSB
@ SDL_PIXELFORMAT_INDEX4MSB
Definition: SDL_pixels.h:183
SDL_PIXELFORMAT_INDEX8
@ SDL_PIXELFORMAT_INDEX8
Definition: SDL_pixels.h:186
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
SDL_PIXELFORMAT_ABGR8888
@ SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:257
SDLTest_TestSuiteReference
Definition: SDL_test_harness.h:89
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