🛠️🐜 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.

533 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. const 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. const 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. const 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/SDL_AllocFormat
  117. * @sa http://wiki.libsdl.org/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 (%" SDL_PRIu32 ")", 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: %" SDL_PRIu32 ", got %" SDL_PRIu32, 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 %" SDL_PRIu32, 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 (%" SDL_PRIu32 ")", _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: %" SDL_PRIu32 ", got %" SDL_PRIu32, 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 %" SDL_PRIu32, 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 (%" SDL_PRIu32 ")", _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(%" SDL_PRIu32 ")", 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/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. const char *result;
  220. /* Blank/undefined format */
  221. format = 0;
  222. SDLTest_Log("RGB Format: %s (%" SDL_PRIu32 ")", unknownFormat, format);
  223. /* Get name of format */
  224. result = 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 (%" SDL_PRIu32 ")", _RGBPixelFormatsVerbose[i], format);
  236. /* Get name of format */
  237. result = 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 (%" SDL_PRIu32 ")", _nonRGBPixelFormatsVerbose[i], format);
  250. /* Get name of format */
  251. result = 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 = SDL_GetPixelFormatName(format);
  267. SDLTest_AssertPass("Call to SDL_GetPixelFormatName(%" SDL_PRIu32 ")", 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/SDL_AllocPalette
  285. * @sa http://wiki.libsdl.org/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. default:
  302. case 1:
  303. ncolors = 1;
  304. break;
  305. /* Two colors */
  306. case 2:
  307. ncolors = 2;
  308. break;
  309. /* More than two colors */
  310. case 3:
  311. ncolors = SDLTest_RandomIntegerInRange(8, 16);
  312. break;
  313. }
  314. result = SDL_AllocPalette(ncolors);
  315. SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors);
  316. SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
  317. if (result != NULL) {
  318. SDLTest_AssertCheck(result->ncolors == ncolors, "Verify value of result.ncolors; expected: %u, got %u", ncolors, result->ncolors);
  319. if (result->ncolors > 0) {
  320. SDLTest_AssertCheck(result->colors != NULL, "Verify value of result.colors is not NULL");
  321. if (result->colors != NULL) {
  322. for(i = 0; i < result->ncolors; i++) {
  323. SDLTest_AssertCheck(result->colors[i].r == 255, "Verify value of result.colors[%d].r; expected: 255, got %u", i, result->colors[i].r);
  324. SDLTest_AssertCheck(result->colors[i].g == 255, "Verify value of result.colors[%d].g; expected: 255, got %u", i, result->colors[i].g);
  325. SDLTest_AssertCheck(result->colors[i].b == 255, "Verify value of result.colors[%d].b; expected: 255, got %u", i, result->colors[i].b);
  326. }
  327. }
  328. }
  329. /* Deallocate again */
  330. SDL_FreePalette(result);
  331. SDLTest_AssertPass("Call to SDL_FreePalette()");
  332. }
  333. }
  334. /* Negative cases */
  335. /* Invalid number of colors */
  336. for (ncolors = 0; ncolors > -3; ncolors--) {
  337. SDL_ClearError();
  338. SDLTest_AssertPass("Call to SDL_ClearError()");
  339. result = SDL_AllocPalette(ncolors);
  340. SDLTest_AssertPass("Call to SDL_AllocPalette(%d)", ncolors);
  341. SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
  342. error = SDL_GetError();
  343. SDLTest_AssertPass("Call to SDL_GetError()");
  344. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  345. if (error != NULL) {
  346. SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0,
  347. "Validate error message, expected: '%s', got: '%s'", expectedError1, error);
  348. }
  349. }
  350. /* Invalid free pointer */
  351. SDL_ClearError();
  352. SDLTest_AssertPass("Call to SDL_ClearError()");
  353. SDL_FreePalette(NULL);
  354. SDLTest_AssertPass("Call to SDL_FreePalette(NULL)");
  355. error = SDL_GetError();
  356. SDLTest_AssertPass("Call to SDL_GetError()");
  357. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  358. if (error != NULL) {
  359. SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
  360. "Validate error message, expected: '%s', got: '%s'", expectedError2, error);
  361. }
  362. return TEST_COMPLETED;
  363. }
  364. /**
  365. * @brief Call to SDL_CalculateGammaRamp
  366. *
  367. * @sa http://wiki.libsdl.org/SDL_CalculateGammaRamp
  368. */
  369. int
  370. pixels_calcGammaRamp(void *arg)
  371. {
  372. const char *expectedError1 = "Parameter 'gamma' is invalid";
  373. const char *expectedError2 = "Parameter 'ramp' is invalid";
  374. const char *error;
  375. float gamma;
  376. Uint16 *ramp;
  377. int variation;
  378. int i;
  379. int changed;
  380. Uint16 magic = 0xbeef;
  381. /* Allocate temp ramp array and fill with some value */
  382. ramp = (Uint16 *)SDL_malloc(256 * sizeof(Uint16));
  383. SDLTest_AssertCheck(ramp != NULL, "Validate temp ramp array could be allocated");
  384. if (ramp == NULL) return TEST_ABORTED;
  385. /* Make call with different gamma values */
  386. for (variation = 0; variation < 4; variation++) {
  387. switch (variation) {
  388. /* gamma = 0 all black */
  389. default:
  390. case 0:
  391. gamma = 0.0f;
  392. break;
  393. /* gamma = 1 identity */
  394. case 1:
  395. gamma = 1.0f;
  396. break;
  397. /* gamma = [0.2,0.8] normal range */
  398. case 2:
  399. gamma = 0.2f + 0.8f * SDLTest_RandomUnitFloat();
  400. break;
  401. /* gamma = >1.1 non-standard range */
  402. case 3:
  403. gamma = 1.1f + SDLTest_RandomUnitFloat();
  404. break;
  405. }
  406. /* Make call and check that values were updated */
  407. for (i = 0; i < 256; i++) ramp[i] = magic;
  408. SDL_CalculateGammaRamp(gamma, ramp);
  409. SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma);
  410. changed = 0;
  411. for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++;
  412. SDLTest_AssertCheck(changed > 250, "Validate that ramp was calculated; expected: >250 values changed, got: %d values changed", changed);
  413. /* Additional value checks for some cases */
  414. i = SDLTest_RandomIntegerInRange(64,192);
  415. switch (variation) {
  416. case 0:
  417. SDLTest_AssertCheck(ramp[i] == 0, "Validate value at position %d; expected: 0, got: %d", i, ramp[i]);
  418. break;
  419. case 1:
  420. SDLTest_AssertCheck(ramp[i] == ((i << 8) | i), "Validate value at position %d; expected: %d, got: %d", i, (i << 8) | i, ramp[i]);
  421. break;
  422. case 2:
  423. case 3:
  424. SDLTest_AssertCheck(ramp[i] > 0, "Validate value at position %d; expected: >0, got: %d", i, ramp[i]);
  425. break;
  426. }
  427. }
  428. /* Negative cases */
  429. SDL_ClearError();
  430. SDLTest_AssertPass("Call to SDL_ClearError()");
  431. gamma = -1;
  432. for (i=0; i<256; i++) ramp[i] = magic;
  433. SDL_CalculateGammaRamp(gamma, ramp);
  434. SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(%f)", gamma);
  435. error = SDL_GetError();
  436. SDLTest_AssertPass("Call to SDL_GetError()");
  437. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  438. if (error != NULL) {
  439. SDLTest_AssertCheck(SDL_strcmp(error, expectedError1) == 0,
  440. "Validate error message, expected: '%s', got: '%s'", expectedError1, error);
  441. }
  442. changed = 0;
  443. for (i = 0; i < 256; i++) if (ramp[i] != magic) changed++;
  444. SDLTest_AssertCheck(changed ==0, "Validate that ramp unchanged; expected: 0 values changed got: %d values changed", changed);
  445. SDL_CalculateGammaRamp(0.5f, NULL);
  446. SDLTest_AssertPass("Call to SDL_CalculateGammaRamp(0.5,NULL)");
  447. error = SDL_GetError();
  448. SDLTest_AssertPass("Call to SDL_GetError()");
  449. SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
  450. if (error != NULL) {
  451. SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
  452. "Validate error message, expected: '%s', got: '%s'", expectedError2, error);
  453. }
  454. /* Cleanup */
  455. SDL_free(ramp);
  456. return TEST_COMPLETED;
  457. }
  458. /* ================= Test References ================== */
  459. /* Pixels test cases */
  460. static const SDLTest_TestCaseReference pixelsTest1 =
  461. { (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_AllocFormat and SDL_FreeFormat", TEST_ENABLED };
  462. static const SDLTest_TestCaseReference pixelsTest2 =
  463. { (SDLTest_TestCaseFp)pixels_allocFreePalette, "pixels_allocFreePalette", "Call to SDL_AllocPalette and SDL_FreePalette", TEST_ENABLED };
  464. static const SDLTest_TestCaseReference pixelsTest3 =
  465. { (SDLTest_TestCaseFp)pixels_calcGammaRamp, "pixels_calcGammaRamp", "Call to SDL_CalculateGammaRamp", TEST_ENABLED };
  466. static const SDLTest_TestCaseReference pixelsTest4 =
  467. { (SDLTest_TestCaseFp)pixels_getPixelFormatName, "pixels_getPixelFormatName", "Call to SDL_GetPixelFormatName", TEST_ENABLED };
  468. /* Sequence of Pixels test cases */
  469. static const SDLTest_TestCaseReference *pixelsTests[] = {
  470. &pixelsTest1, &pixelsTest2, &pixelsTest3, &pixelsTest4, NULL
  471. };
  472. /* Pixels test suite (global) */
  473. SDLTest_TestSuiteReference pixelsTestSuite = {
  474. "Pixels",
  475. NULL,
  476. pixelsTests,
  477. NULL
  478. };