testautomation_pixels.c 18 KB

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