🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

531 lines
18 KiB

  1. /**
  2. * Pixels test suite
  3. */
  4. #include <stdio.h>
  5. #include "SDL.h"
  6. #include "SDL_test.h"
  7. /* Test case functions */
  8. /* Definition of all RGB formats used to test pixel conversions */
  9. const int _numRGBPixelFormats = 31;
  10. Uint32 _RGBPixelFormats[] =
  11. {
  12. SDL_PIXELFORMAT_INDEX1LSB,
  13. SDL_PIXELFORMAT_INDEX1MSB,
  14. SDL_PIXELFORMAT_INDEX4LSB,
  15. SDL_PIXELFORMAT_INDEX4MSB,
  16. SDL_PIXELFORMAT_INDEX8,
  17. SDL_PIXELFORMAT_RGB332,
  18. SDL_PIXELFORMAT_RGB444,
  19. SDL_PIXELFORMAT_BGR444,
  20. SDL_PIXELFORMAT_RGB555,
  21. SDL_PIXELFORMAT_BGR555,
  22. SDL_PIXELFORMAT_ARGB4444,
  23. SDL_PIXELFORMAT_RGBA4444,
  24. SDL_PIXELFORMAT_ABGR4444,
  25. SDL_PIXELFORMAT_BGRA4444,
  26. SDL_PIXELFORMAT_ARGB1555,
  27. SDL_PIXELFORMAT_RGBA5551,
  28. SDL_PIXELFORMAT_ABGR1555,
  29. SDL_PIXELFORMAT_BGRA5551,
  30. SDL_PIXELFORMAT_RGB565,
  31. SDL_PIXELFORMAT_BGR565,
  32. SDL_PIXELFORMAT_RGB24,
  33. SDL_PIXELFORMAT_BGR24,
  34. SDL_PIXELFORMAT_RGB888,
  35. SDL_PIXELFORMAT_RGBX8888,
  36. SDL_PIXELFORMAT_BGR888,
  37. SDL_PIXELFORMAT_BGRX8888,
  38. SDL_PIXELFORMAT_ARGB8888,
  39. SDL_PIXELFORMAT_RGBA8888,
  40. SDL_PIXELFORMAT_ABGR8888,
  41. SDL_PIXELFORMAT_BGRA8888,
  42. SDL_PIXELFORMAT_ARGB2101010
  43. };
  44. char* _RGBPixelFormatsVerbose[] =
  45. {
  46. "SDL_PIXELFORMAT_INDEX1LSB",
  47. "SDL_PIXELFORMAT_INDEX1MSB",
  48. "SDL_PIXELFORMAT_INDEX4LSB",
  49. "SDL_PIXELFORMAT_INDEX4MSB",
  50. "SDL_PIXELFORMAT_INDEX8",
  51. "SDL_PIXELFORMAT_RGB332",
  52. "SDL_PIXELFORMAT_RGB444",
  53. "SDL_PIXELFORMAT_BGR444",
  54. "SDL_PIXELFORMAT_RGB555",
  55. "SDL_PIXELFORMAT_BGR555",
  56. "SDL_PIXELFORMAT_ARGB4444",
  57. "SDL_PIXELFORMAT_RGBA4444",
  58. "SDL_PIXELFORMAT_ABGR4444",
  59. "SDL_PIXELFORMAT_BGRA4444",
  60. "SDL_PIXELFORMAT_ARGB1555",
  61. "SDL_PIXELFORMAT_RGBA5551",
  62. "SDL_PIXELFORMAT_ABGR1555",
  63. "SDL_PIXELFORMAT_BGRA5551",
  64. "SDL_PIXELFORMAT_RGB565",
  65. "SDL_PIXELFORMAT_BGR565",
  66. "SDL_PIXELFORMAT_RGB24",
  67. "SDL_PIXELFORMAT_BGR24",
  68. "SDL_PIXELFORMAT_RGB888",
  69. "SDL_PIXELFORMAT_RGBX8888",
  70. "SDL_PIXELFORMAT_BGR888",
  71. "SDL_PIXELFORMAT_BGRX8888",
  72. "SDL_PIXELFORMAT_ARGB8888",
  73. "SDL_PIXELFORMAT_RGBA8888",
  74. "SDL_PIXELFORMAT_ABGR8888",
  75. "SDL_PIXELFORMAT_BGRA8888",
  76. "SDL_PIXELFORMAT_ARGB2101010"
  77. };
  78. /* Definition of all Non-RGB formats used to test pixel conversions */
  79. const int _numNonRGBPixelFormats = 7;
  80. Uint32 _nonRGBPixelFormats[] =
  81. {
  82. SDL_PIXELFORMAT_YV12,
  83. SDL_PIXELFORMAT_IYUV,
  84. SDL_PIXELFORMAT_YUY2,
  85. SDL_PIXELFORMAT_UYVY,
  86. SDL_PIXELFORMAT_YVYU,
  87. SDL_PIXELFORMAT_NV12,
  88. SDL_PIXELFORMAT_NV21
  89. };
  90. char* _nonRGBPixelFormatsVerbose[] =
  91. {
  92. "SDL_PIXELFORMAT_YV12",
  93. "SDL_PIXELFORMAT_IYUV",
  94. "SDL_PIXELFORMAT_YUY2",
  95. "SDL_PIXELFORMAT_UYVY",
  96. "SDL_PIXELFORMAT_YVYU",
  97. "SDL_PIXELFORMAT_NV12",
  98. "SDL_PIXELFORMAT_NV21"
  99. };
  100. /* Definition of some invalid formats for negative tests */
  101. const int _numInvalidPixelFormats = 2;
  102. Uint32 _invalidPixelFormats[] =
  103. {
  104. 0xfffffffe,
  105. 0xffffffff
  106. };
  107. char* _invalidPixelFormatsVerbose[] =
  108. {
  109. "SDL_PIXELFORMAT_UNKNOWN",
  110. "SDL_PIXELFORMAT_UNKNOWN"
  111. };
  112. /* Test case functions */
  113. /**
  114. * @brief Call to SDL_AllocFormat and SDL_FreeFormat
  115. *
  116. * @sa http://wiki.libsdl.org/moin.fcg/SDL_AllocFormat
  117. * @sa http://wiki.libsdl.org/moin.fcg/SDL_FreeFormat
  118. */
  119. int
  120. pixels_allocFreeFormat(void *arg)
  121. {
  122. const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
  123. const char *expectedError = "Parameter 'format' is invalid";
  124. const char *error;
  125. int i;
  126. Uint32 format;
  127. Uint32 masks;
  128. SDL_PixelFormat* result;
  129. /* Blank/unknown format */
  130. format = 0;
  131. SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
  132. /* Allocate format */
  133. result = SDL_AllocFormat(format);
  134. SDLTest_AssertPass("Call to SDL_AllocFormat()");
  135. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  136. if (result != NULL) {
  137. SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
  138. SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel);
  139. SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel);
  140. masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
  141. SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %u", masks);
  142. /* Deallocate again */
  143. SDL_FreeFormat(result);
  144. SDLTest_AssertPass("Call to SDL_FreeFormat()");
  145. }
  146. /* RGB formats */
  147. for (i = 0; i < _numRGBPixelFormats; i++) {
  148. format = _RGBPixelFormats[i];
  149. SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
  150. /* Allocate format */
  151. result = SDL_AllocFormat(format);
  152. SDLTest_AssertPass("Call to SDL_AllocFormat()");
  153. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  154. if (result != NULL) {
  155. SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %u, got %u", format, result->format);
  156. SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);
  157. SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);
  158. if (result->palette != NULL) {
  159. masks = result->Rmask | result->Gmask | result->Bmask | result->Amask;
  160. SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %u", masks);
  161. }
  162. /* Deallocate again */
  163. SDL_FreeFormat(result);
  164. SDLTest_AssertPass("Call to SDL_FreeFormat()");
  165. }
  166. }
  167. /* Non-RGB formats */
  168. for (i = 0; i < _numNonRGBPixelFormats; i++) {
  169. format = _nonRGBPixelFormats[i];
  170. SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
  171. /* Try to allocate format */
  172. result = SDL_AllocFormat(format);
  173. SDLTest_AssertPass("Call to SDL_AllocFormat()");
  174. SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
  175. }
  176. /* Negative cases */
  177. /* Invalid Formats */
  178. for (i = 0; i < _numInvalidPixelFormats; i++) {
  179. SDL_ClearError();
  180. SDLTest_AssertPass("Call to SDL_ClearError()");
  181. format = _invalidPixelFormats[i];
  182. result = SDL_AllocFormat(format);
  183. SDLTest_AssertPass("Call to SDL_AllocFormat(%u)", format);
  184. SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
  185. error = SDL_GetError();
  186. SDLTest_AssertPass("Call to SDL_GetError()");
  187. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  188. if (error != NULL) {
  189. SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
  190. "Validate error message, expected: '%s', got: '%s'", expectedError, error);
  191. }
  192. }
  193. /* Invalid free pointer */
  194. SDL_ClearError();
  195. SDLTest_AssertPass("Call to SDL_ClearError()");
  196. SDL_FreeFormat(NULL);
  197. SDLTest_AssertPass("Call to SDL_FreeFormat(NULL)");
  198. error = SDL_GetError();
  199. SDLTest_AssertPass("Call to SDL_GetError()");
  200. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  201. if (error != NULL) {
  202. SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
  203. "Validate error message, expected: '%s', got: '%s'", expectedError, error);
  204. }
  205. return TEST_COMPLETED;
  206. }
  207. /**
  208. * @brief Call to SDL_GetPixelFormatName
  209. *
  210. * @sa http://wiki.libsdl.org/moin.fcg/SDL_GetPixelFormatName
  211. */
  212. int
  213. pixels_getPixelFormatName(void *arg)
  214. {
  215. const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
  216. const char *error;
  217. int i;
  218. Uint32 format;
  219. char* result;
  220. /* Blank/undefined format */
  221. format = 0;
  222. SDLTest_Log("RGB Format: %s (%u)", unknownFormat, format);
  223. /* Get name of format */
  224. result = (char *)SDL_GetPixelFormatName(format);
  225. SDLTest_AssertPass("Call to SDL_GetPixelFormatName()");
  226. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  227. if (result != NULL) {
  228. SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
  229. SDLTest_AssertCheck(SDL_strcmp(result, unknownFormat) == 0,
  230. "Verify result text; expected: %s, got %s", unknownFormat, result);
  231. }
  232. /* RGB formats */
  233. for (i = 0; i < _numRGBPixelFormats; i++) {
  234. format = _RGBPixelFormats[i];
  235. SDLTest_Log("RGB Format: %s (%u)", _RGBPixelFormatsVerbose[i], format);
  236. /* Get name of format */
  237. result = (char *)SDL_GetPixelFormatName(format);
  238. SDLTest_AssertPass("Call to SDL_GetPixelFormatName()");
  239. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  240. if (result != NULL) {
  241. SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
  242. SDLTest_AssertCheck(SDL_strcmp(result, _RGBPixelFormatsVerbose[i]) == 0,
  243. "Verify result text; expected: %s, got %s", _RGBPixelFormatsVerbose[i], result);
  244. }
  245. }
  246. /* Non-RGB formats */
  247. for (i = 0; i < _numNonRGBPixelFormats; i++) {
  248. format = _nonRGBPixelFormats[i];
  249. SDLTest_Log("non-RGB Format: %s (%u)", _nonRGBPixelFormatsVerbose[i], format);
  250. /* Get name of format */
  251. result = (char *)SDL_GetPixelFormatName(format);
  252. SDLTest_AssertPass("Call to SDL_GetPixelFormatName()");
  253. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  254. if (result != NULL) {
  255. SDLTest_AssertCheck(result[0] != '\0', "Verify result is non-empty");
  256. SDLTest_AssertCheck(SDL_strcmp(result, _nonRGBPixelFormatsVerbose[i]) == 0,
  257. "Verify result text; expected: %s, got %s", _nonRGBPixelFormatsVerbose[i], result);
  258. }
  259. }
  260. /* Negative cases */
  261. /* Invalid Formats */
  262. SDL_ClearError();
  263. SDLTest_AssertPass("Call to SDL_ClearError()");
  264. for (i = 0; i < _numInvalidPixelFormats; i++) {
  265. format = _invalidPixelFormats[i];
  266. result = (char *)SDL_GetPixelFormatName(format);
  267. SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%u)", format);
  268. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  269. if (result != NULL) {
  270. SDLTest_AssertCheck(result[0] != '\0',
  271. "Verify result is non-empty; got: %s", result);
  272. SDLTest_AssertCheck(SDL_strcmp(result, _invalidPixelFormatsVerbose[i]) == 0,
  273. "Validate name is UNKNOWN, expected: '%s', got: '%s'", _invalidPixelFormatsVerbose[i], result);
  274. }
  275. error = SDL_GetError();
  276. SDLTest_AssertPass("Call to SDL_GetError()");
  277. SDLTest_AssertCheck(error == NULL || error[0] == '\0', "Validate that error message is empty");
  278. }
  279. return TEST_COMPLETED;
  280. }
  281. /**
  282. * @brief Call to SDL_AllocPalette and SDL_FreePalette
  283. *
  284. * @sa http://wiki.libsdl.org/moin.fcg/SDL_AllocPalette
  285. * @sa http://wiki.libsdl.org/moin.fcg/SDL_FreePalette
  286. */
  287. int
  288. pixels_allocFreePalette(void *arg)
  289. {
  290. const char *expectedError1 = "Parameter 'ncolors' is invalid";
  291. const char *expectedError2 = "Parameter 'palette' is invalid";
  292. const char *error;
  293. int variation;
  294. int i;
  295. int ncolors;
  296. SDL_Palette* result;
  297. /* Allocate palette */
  298. for (variation = 1; variation <= 3; variation++) {
  299. switch (variation) {
  300. /* Just one color */
  301. case 1:
  302. ncolors = 1;
  303. break;
  304. /* Two colors */
  305. case 2:
  306. ncolors = 2;
  307. break;
  308. /* More than two colors */
  309. case 3:
  310. ncolors = SDLTest_RandomIntegerInRange(8, 16);
  311. break;
  312. }
  313. result = SDL_AllocPalette(ncolors);
  314. SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors);
  315. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  316. if (result != NULL) {
  317. SDLTest_AssertCheck(result->ncolors == ncolors, "Verify value of result.ncolors; expected: %u, got %u", ncolors, result->ncolors);
  318. if (result->ncolors > 0) {
  319. SDLTest_AssertCheck(result->colors != NULL, "Verify value of result.colors is not NULL");
  320. if (result->colors != NULL) {
  321. for(i = 0; i < result->ncolors; i++) {
  322. SDLTest_AssertCheck(result->colors[i].r == 255, "Verify value of result.colors[%d].r; expected: 255, got %u", i, result->colors[i].r);
  323. SDLTest_AssertCheck(result->colors[i].g == 255, "Verify value of result.colors[%d].g; expected: 255, got %u", i, result->colors[i].g);
  324. SDLTest_AssertCheck(result->colors[i].b == 255, "Verify value of result.colors[%d].b; expected: 255, got %u", i, result->colors[i].b);
  325. }
  326. }
  327. }
  328. /* Deallocate again */
  329. SDL_FreePalette(result);
  330. SDLTest_AssertPass("Call to SDL_FreePalette()");
  331. }
  332. }
  333. /* Negative cases */
  334. /* Invalid number of colors */
  335. for (ncolors = 0; ncolors > -3; ncolors--) {
  336. SDL_ClearError();
  337. SDLTest_AssertPass("Call to SDL_ClearError()");
  338. result = SDL_AllocPalette(ncolors);
  339. SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors);
  340. SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
  341. error = SDL_GetError();
  342. SDLTest_AssertPass("Call to SDL_GetError()");
  343. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  344. if (error != NULL) {
  345. SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0,
  346. "Validate error message, expected: '%s', got: '%s'", expectedError1, error);
  347. }
  348. }
  349. /* Invalid free pointer */
  350. SDL_ClearError();
  351. SDLTest_AssertPass("Call to SDL_ClearError()");
  352. SDL_FreePalette(NULL);
  353. SDLTest_AssertPass("Call to SDL_FreePalette(NULL)");
  354. error = SDL_GetError();
  355. SDLTest_AssertPass("Call to SDL_GetError()");
  356. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  357. if (error != NULL) {
  358. SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
  359. "Validate error message, expected: '%s', got: '%s'", expectedError2, error);
  360. }
  361. return TEST_COMPLETED;
  362. }
  363. /**
  364. * @brief Call to SDL_CalculateGammaRamp
  365. *
  366. * @sa http://wiki.libsdl.org/moin.fcg/SDL_CalculateGammaRamp
  367. */
  368. int
  369. pixels_calcGammaRamp(void *arg)
  370. {
  371. const char *expectedError1 = "Parameter 'gamma' is invalid";
  372. const char *expectedError2 = "Parameter 'ramp' is invalid";
  373. const char *error;
  374. float gamma;
  375. Uint16 *ramp;
  376. int variation;
  377. int i;
  378. int changed;
  379. Uint16 magic = 0xbeef;
  380. /* Allocate temp ramp array and fill with some value */
  381. ramp = (Uint16 *)SDL_malloc(256 * sizeof(Uint16));
  382. SDLTest_AssertCheck(ramp != NULL, "Validate temp ramp array could be allocated");
  383. if (ramp == NULL) return TEST_ABORTED;
  384. /* Make call with different gamma values */
  385. for (variation = 0; variation < 4; variation++) {
  386. switch (variation) {
  387. /* gamma = 0 all black */
  388. case 0:
  389. gamma = 0.0f;
  390. break;
  391. /* gamma = 1 identity */
  392. case 1:
  393. gamma = 1.0f;
  394. break;
  395. /* gamma = [0.2,0.8] normal range */
  396. case 2:
  397. gamma = 0.2f + 0.8f * SDLTest_RandomUnitFloat();
  398. break;
  399. /* gamma = >1.1 non-standard range */
  400. case 3:
  401. gamma = 1.1f + SDLTest_RandomUnitFloat();
  402. break;
  403. }
  404. /* Make call and check that values were updated */
  405. for (i = 0; i < 256; i++) ramp[i] = magic;
  406. SDL_CalculateGammaRamp(gamma, ramp);
  407. SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma);
  408. changed = 0;
  409. for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++;
  410. SDLTest_AssertCheck(changed > 250, "Validate that ramp was calculated; expected: >250 values changed, got: %d values changed", changed);
  411. /* Additional value checks for some cases */
  412. i = SDLTest_RandomIntegerInRange(64,192);
  413. switch (variation) {
  414. case 0:
  415. SDLTest_AssertCheck(ramp[i] == 0, "Validate value at position %d; expected: 0, got: %d", i, ramp[i]);
  416. break;
  417. case 1:
  418. SDLTest_AssertCheck(ramp[i] == ((i << 8) | i), "Validate value at position %d; expected: %d, got: %d", i, (i << 8) | i, ramp[i]);
  419. break;
  420. case 2:
  421. case 3:
  422. SDLTest_AssertCheck(ramp[i] > 0, "Validate value at position %d; expected: >0, got: %d", i, ramp[i]);
  423. break;
  424. }
  425. }
  426. /* Negative cases */
  427. SDL_ClearError();
  428. SDLTest_AssertPass("Call to SDL_ClearError()");
  429. gamma = -1;
  430. for (i=0; i<256; i++) ramp[i] = magic;
  431. SDL_CalculateGammaRamp(gamma, ramp);
  432. SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma);
  433. error = SDL_GetError();
  434. SDLTest_AssertPass("Call to SDL_GetError()");
  435. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  436. if (error != NULL) {
  437. SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0,
  438. "Validate error message, expected: '%s', got: '%s'", expectedError1, error);
  439. }
  440. changed = 0;
  441. for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++;
  442. SDLTest_AssertCheck(changed ==0, "Validate that ramp unchanged; expected: 0 values changed got: %d values changed", changed);
  443. SDL_CalculateGammaRamp(0.5f, NULL);
  444. SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(0.5,NULL)");
  445. error = SDL_GetError();
  446. SDLTest_AssertPass("Call to SDL_GetError()");
  447. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  448. if (error != NULL) {
  449. SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
  450. "Validate error message, expected: '%s', got: '%s'", expectedError2, error);
  451. }
  452. /* Cleanup */
  453. SDL_free(ramp);
  454. return TEST_COMPLETED;
  455. }
  456. /* ================= Test References ================== */
  457. /* Pixels test cases */
  458. static const SDLTest_TestCaseReference pixelsTest1 =
  459. { (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED };
  460. static const SDLTest_TestCaseReference pixelsTest2 =
  461. { (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED };
  462. static const SDLTest_TestCaseReference pixelsTest3 =
  463. { (SDLTest_TestCaseFp)pixels_calcGammaRamp, "pixels_calcGammaRamp", "Call to SDL_CalculateGammaRamp", TEST_ENABLED };
  464. static const SDLTest_TestCaseReference pixelsTest4 =
  465. { (SDLTest_TestCaseFp)pixels_getPixelFormatName, "pixels_getPixelFormatName", "Call to SDL_GetPixelFormatName", TEST_ENABLED };
  466. /* Sequence of Pixels test cases */
  467. static const SDLTest_TestCaseReference *pixelsTests[] = {
  468. &pixelsTest1, &pixelsTest2, &pixelsTest3, &pixelsTest4, NULL
  469. };
  470. /* Pixels test suite (global) */
  471. SDLTest_TestSuiteReference pixelsTestSuite = {
  472. "Pixels",
  473. NULL,
  474. pixelsTests,
  475. NULL
  476. };