testautomation_platform.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. /**
  2. * Original code: automated SDL platform test written by Edgar Simo "bobbens"
  3. * Extended and updated by aschiffler at ferzkopp dot net
  4. */
  5. #include <SDL3/SDL.h>
  6. #include <SDL3/SDL_test.h>
  7. /* ================= Test Case Implementation ================== */
  8. /* Helper functions */
  9. /**
  10. * @brief Compare sizes of types.
  11. *
  12. * @note Watcom C flags these as Warning 201: "Unreachable code" if you just
  13. * compare them directly, so we push it through a function to keep the
  14. * compiler quiet. --ryan.
  15. */
  16. static int compareSizeOfType(size_t sizeoftype, size_t hardcodetype)
  17. {
  18. return sizeoftype != hardcodetype;
  19. }
  20. /* Test case functions */
  21. /**
  22. * @brief Tests type sizes.
  23. */
  24. int platform_testTypes(void *arg)
  25. {
  26. int ret;
  27. ret = compareSizeOfType(sizeof(Uint8), 1);
  28. SDLTest_AssertCheck(ret == 0, "sizeof(Uint8) = %u, expected 1", (unsigned int)sizeof(Uint8));
  29. ret = compareSizeOfType(sizeof(Uint16), 2);
  30. SDLTest_AssertCheck(ret == 0, "sizeof(Uint16) = %u, expected 2", (unsigned int)sizeof(Uint16));
  31. ret = compareSizeOfType(sizeof(Uint32), 4);
  32. SDLTest_AssertCheck(ret == 0, "sizeof(Uint32) = %u, expected 4", (unsigned int)sizeof(Uint32));
  33. ret = compareSizeOfType(sizeof(Uint64), 8);
  34. SDLTest_AssertCheck(ret == 0, "sizeof(Uint64) = %u, expected 8", (unsigned int)sizeof(Uint64));
  35. return TEST_COMPLETED;
  36. }
  37. /**
  38. * @brief Tests platform endianness and SDL_SwapXY functions.
  39. */
  40. int platform_testEndianessAndSwap(void *arg)
  41. {
  42. int real_byteorder;
  43. int real_floatwordorder = 0;
  44. Uint16 value = 0x1234;
  45. Uint16 value16 = 0xCDAB;
  46. Uint16 swapped16 = 0xABCD;
  47. Uint32 value32 = 0xEFBEADDE;
  48. Uint32 swapped32 = 0xDEADBEEF;
  49. union
  50. {
  51. double d;
  52. Uint32 ui32[2];
  53. } value_double;
  54. Uint64 value64, swapped64;
  55. value64 = 0xEFBEADDE;
  56. value64 <<= 32;
  57. value64 |= 0xCDAB3412;
  58. swapped64 = 0x1234ABCD;
  59. swapped64 <<= 32;
  60. swapped64 |= 0xDEADBEEF;
  61. value_double.d = 3.141593;
  62. if ((*((char *)&value) >> 4) == 0x1) {
  63. real_byteorder = SDL_BIG_ENDIAN;
  64. } else {
  65. real_byteorder = SDL_LIL_ENDIAN;
  66. }
  67. /* Test endianness. */
  68. SDLTest_AssertCheck(real_byteorder == SDL_BYTEORDER,
  69. "Machine detected as %s endian, appears to be %s endian.",
  70. (SDL_BYTEORDER == SDL_LIL_ENDIAN) ? "little" : "big",
  71. (real_byteorder == SDL_LIL_ENDIAN) ? "little" : "big");
  72. if (value_double.ui32[0] == 0x82c2bd7f && value_double.ui32[1] == 0x400921fb) {
  73. real_floatwordorder = SDL_LIL_ENDIAN;
  74. } else if (value_double.ui32[0] == 0x400921fb && value_double.ui32[1] == 0x82c2bd7f) {
  75. real_floatwordorder = SDL_BIG_ENDIAN;
  76. }
  77. /* Test endianness. */
  78. SDLTest_AssertCheck(real_floatwordorder == SDL_FLOATWORDORDER,
  79. "Machine detected as having %s endian float word order, appears to be %s endian.",
  80. (SDL_FLOATWORDORDER == SDL_LIL_ENDIAN) ? "little" : "big",
  81. (real_floatwordorder == SDL_LIL_ENDIAN) ? "little" : (real_floatwordorder == SDL_BIG_ENDIAN) ? "big"
  82. : "unknown");
  83. /* Test 16 swap. */
  84. SDLTest_AssertCheck(SDL_Swap16(value16) == swapped16,
  85. "SDL_Swap16(): 16 bit swapped: 0x%X => 0x%X",
  86. value16, SDL_Swap16(value16));
  87. /* Test 32 swap. */
  88. SDLTest_AssertCheck(SDL_Swap32(value32) == swapped32,
  89. "SDL_Swap32(): 32 bit swapped: 0x%" SDL_PRIX32 " => 0x%" SDL_PRIX32,
  90. value32, SDL_Swap32(value32));
  91. /* Test 64 swap. */
  92. SDLTest_AssertCheck(SDL_Swap64(value64) == swapped64,
  93. "SDL_Swap64(): 64 bit swapped: 0x%" SDL_PRIX64 " => 0x%" SDL_PRIX64,
  94. value64, SDL_Swap64(value64));
  95. return TEST_COMPLETED;
  96. }
  97. /* !
  98. * \brief Tests SDL_GetXYZ() functions
  99. * \sa
  100. * http://wiki.libsdl.org/SDL_GetPlatform
  101. * http://wiki.libsdl.org/SDL_GetCPUCount
  102. * http://wiki.libsdl.org/SDL_GetCPUCacheLineSize
  103. * http://wiki.libsdl.org/SDL_GetRevision
  104. */
  105. int platform_testGetFunctions(void *arg)
  106. {
  107. char *platform;
  108. char *revision;
  109. int ret;
  110. size_t len;
  111. platform = (char *)SDL_GetPlatform();
  112. SDLTest_AssertPass("SDL_GetPlatform()");
  113. SDLTest_AssertCheck(platform != NULL, "SDL_GetPlatform() != NULL");
  114. if (platform != NULL) {
  115. len = SDL_strlen(platform);
  116. SDLTest_AssertCheck(len > 0,
  117. "SDL_GetPlatform(): expected non-empty platform, was platform: '%s', len: %i",
  118. platform,
  119. (int)len);
  120. }
  121. ret = SDL_GetCPUCount();
  122. SDLTest_AssertPass("SDL_GetCPUCount()");
  123. SDLTest_AssertCheck(ret > 0,
  124. "SDL_GetCPUCount(): expected count > 0, was: %i",
  125. ret);
  126. ret = SDL_GetCPUCacheLineSize();
  127. SDLTest_AssertPass("SDL_GetCPUCacheLineSize()");
  128. SDLTest_AssertCheck(ret >= 0,
  129. "SDL_GetCPUCacheLineSize(): expected size >= 0, was: %i",
  130. ret);
  131. revision = (char *)SDL_GetRevision();
  132. SDLTest_AssertPass("SDL_GetRevision()");
  133. SDLTest_AssertCheck(revision != NULL, "SDL_GetRevision() != NULL");
  134. return TEST_COMPLETED;
  135. }
  136. /* !
  137. * \brief Tests SDL_HasXYZ() functions
  138. * \sa
  139. * http://wiki.libsdl.org/SDL_HasAltiVec
  140. * http://wiki.libsdl.org/SDL_HasMMX
  141. * http://wiki.libsdl.org/SDL_HasRDTSC
  142. * http://wiki.libsdl.org/SDL_HasSSE
  143. * http://wiki.libsdl.org/SDL_HasSSE2
  144. * http://wiki.libsdl.org/SDL_HasSSE3
  145. * http://wiki.libsdl.org/SDL_HasSSE41
  146. * http://wiki.libsdl.org/SDL_HasSSE42
  147. * http://wiki.libsdl.org/SDL_HasAVX
  148. */
  149. int platform_testHasFunctions(void *arg)
  150. {
  151. /* TODO: independently determine and compare values as well */
  152. SDL_HasRDTSC();
  153. SDLTest_AssertPass("SDL_HasRDTSC()");
  154. SDL_HasAltiVec();
  155. SDLTest_AssertPass("SDL_HasAltiVec()");
  156. SDL_HasMMX();
  157. SDLTest_AssertPass("SDL_HasMMX()");
  158. SDL_HasSSE();
  159. SDLTest_AssertPass("SDL_HasSSE()");
  160. SDL_HasSSE2();
  161. SDLTest_AssertPass("SDL_HasSSE2()");
  162. SDL_HasSSE3();
  163. SDLTest_AssertPass("SDL_HasSSE3()");
  164. SDL_HasSSE41();
  165. SDLTest_AssertPass("SDL_HasSSE41()");
  166. SDL_HasSSE42();
  167. SDLTest_AssertPass("SDL_HasSSE42()");
  168. SDL_HasAVX();
  169. SDLTest_AssertPass("SDL_HasAVX()");
  170. return TEST_COMPLETED;
  171. }
  172. /* !
  173. * \brief Tests SDL_GetVersion
  174. * \sa
  175. * http://wiki.libsdl.org/SDL_GetVersion
  176. */
  177. int platform_testGetVersion(void *arg)
  178. {
  179. SDL_version linked;
  180. int major = SDL_MAJOR_VERSION;
  181. int minor = SDL_MINOR_VERSION;
  182. SDL_GetVersion(&linked);
  183. SDLTest_AssertCheck(linked.major >= major,
  184. "SDL_GetVersion(): returned major %i (>= %i)",
  185. linked.major,
  186. major);
  187. SDLTest_AssertCheck(linked.minor >= minor,
  188. "SDL_GetVersion(): returned minor %i (>= %i)",
  189. linked.minor,
  190. minor);
  191. return TEST_COMPLETED;
  192. }
  193. /* !
  194. * \brief Tests SDL_VERSION macro
  195. */
  196. int platform_testSDLVersion(void *arg)
  197. {
  198. SDL_version compiled;
  199. int major = SDL_MAJOR_VERSION;
  200. int minor = SDL_MINOR_VERSION;
  201. SDL_VERSION(&compiled);
  202. SDLTest_AssertCheck(compiled.major >= major,
  203. "SDL_VERSION() returned major %i (>= %i)",
  204. compiled.major,
  205. major);
  206. SDLTest_AssertCheck(compiled.minor >= minor,
  207. "SDL_VERSION() returned minor %i (>= %i)",
  208. compiled.minor,
  209. minor);
  210. return TEST_COMPLETED;
  211. }
  212. /* !
  213. * \brief Tests default SDL_Init
  214. */
  215. int platform_testDefaultInit(void *arg)
  216. {
  217. int ret;
  218. int subsystem;
  219. subsystem = SDL_WasInit(SDL_INIT_EVERYTHING);
  220. SDLTest_AssertCheck(subsystem != 0,
  221. "SDL_WasInit(0): returned %i, expected != 0",
  222. subsystem);
  223. ret = SDL_Init(SDL_WasInit(SDL_INIT_EVERYTHING));
  224. SDLTest_AssertCheck(ret == 0,
  225. "SDL_Init(0): returned %i, expected 0, error: %s",
  226. ret,
  227. SDL_GetError());
  228. return TEST_COMPLETED;
  229. }
  230. /* !
  231. * \brief Tests SDL_Get/Set/ClearError
  232. * \sa
  233. * http://wiki.libsdl.org/SDL_GetError
  234. * http://wiki.libsdl.org/SDL_SetError
  235. * http://wiki.libsdl.org/SDL_ClearError
  236. */
  237. int platform_testGetSetClearError(void *arg)
  238. {
  239. int result;
  240. const char *testError = "Testing";
  241. char *lastError;
  242. size_t len;
  243. SDL_ClearError();
  244. SDLTest_AssertPass("SDL_ClearError()");
  245. lastError = (char *)SDL_GetError();
  246. SDLTest_AssertPass("SDL_GetError()");
  247. SDLTest_AssertCheck(lastError != NULL,
  248. "SDL_GetError() != NULL");
  249. if (lastError != NULL) {
  250. len = SDL_strlen(lastError);
  251. SDLTest_AssertCheck(len == 0,
  252. "SDL_GetError(): no message expected, len: %i", (int)len);
  253. }
  254. result = SDL_SetError("%s", testError);
  255. SDLTest_AssertPass("SDL_SetError()");
  256. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  257. lastError = (char *)SDL_GetError();
  258. SDLTest_AssertCheck(lastError != NULL,
  259. "SDL_GetError() != NULL");
  260. if (lastError != NULL) {
  261. len = SDL_strlen(lastError);
  262. SDLTest_AssertCheck(len == SDL_strlen(testError),
  263. "SDL_GetError(): expected message len %i, was len: %i",
  264. (int)SDL_strlen(testError),
  265. (int)len);
  266. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  267. "SDL_GetError(): expected message %s, was message: %s",
  268. testError,
  269. lastError);
  270. }
  271. /* Clean up */
  272. SDL_ClearError();
  273. SDLTest_AssertPass("SDL_ClearError()");
  274. return TEST_COMPLETED;
  275. }
  276. /* !
  277. * \brief Tests SDL_SetError with empty input
  278. * \sa
  279. * http://wiki.libsdl.org/SDL_SetError
  280. */
  281. int platform_testSetErrorEmptyInput(void *arg)
  282. {
  283. int result;
  284. const char *testError = "";
  285. char *lastError;
  286. size_t len;
  287. result = SDL_SetError("%s", testError);
  288. SDLTest_AssertPass("SDL_SetError()");
  289. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  290. lastError = (char *)SDL_GetError();
  291. SDLTest_AssertCheck(lastError != NULL,
  292. "SDL_GetError() != NULL");
  293. if (lastError != NULL) {
  294. len = SDL_strlen(lastError);
  295. SDLTest_AssertCheck(len == SDL_strlen(testError),
  296. "SDL_GetError(): expected message len %i, was len: %i",
  297. (int)SDL_strlen(testError),
  298. (int)len);
  299. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  300. "SDL_GetError(): expected message '%s', was message: '%s'",
  301. testError,
  302. lastError);
  303. }
  304. /* Clean up */
  305. SDL_ClearError();
  306. SDLTest_AssertPass("SDL_ClearError()");
  307. return TEST_COMPLETED;
  308. }
  309. #if defined(HAVE_WFORMAT_OVERFLOW)
  310. #pragma GCC diagnostic push
  311. #pragma GCC diagnostic ignored "-Wformat-overflow"
  312. #endif
  313. /* !
  314. * \brief Tests SDL_SetError with invalid input
  315. * \sa
  316. * http://wiki.libsdl.org/SDL_SetError
  317. */
  318. int platform_testSetErrorInvalidInput(void *arg)
  319. {
  320. int result;
  321. const char *invalidError = NULL;
  322. const char *probeError = "Testing";
  323. char *lastError;
  324. size_t len;
  325. /* Reset */
  326. SDL_ClearError();
  327. SDLTest_AssertPass("SDL_ClearError()");
  328. /* Check for no-op */
  329. result = SDL_SetError("%s", invalidError);
  330. SDLTest_AssertPass("SDL_SetError()");
  331. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  332. lastError = (char *)SDL_GetError();
  333. SDLTest_AssertCheck(lastError != NULL,
  334. "SDL_GetError() != NULL");
  335. if (lastError != NULL) {
  336. len = SDL_strlen(lastError);
  337. SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0,
  338. "SDL_GetError(): expected message len 0, was len: %i",
  339. (int)len);
  340. }
  341. /* Set */
  342. result = SDL_SetError("%s", probeError);
  343. SDLTest_AssertPass("SDL_SetError('%s')", probeError);
  344. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  345. /* Check for no-op */
  346. result = SDL_SetError("%s", invalidError);
  347. SDLTest_AssertPass("SDL_SetError(NULL)");
  348. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  349. lastError = (char *)SDL_GetError();
  350. SDLTest_AssertCheck(lastError != NULL,
  351. "SDL_GetError() != NULL");
  352. if (lastError != NULL) {
  353. len = SDL_strlen(lastError);
  354. SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0,
  355. "SDL_GetError(): expected message len 0, was len: %i",
  356. (int)len);
  357. }
  358. /* Reset */
  359. SDL_ClearError();
  360. SDLTest_AssertPass("SDL_ClearError()");
  361. /* Set and check */
  362. result = SDL_SetError("%s", probeError);
  363. SDLTest_AssertPass("SDL_SetError()");
  364. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  365. lastError = (char *)SDL_GetError();
  366. SDLTest_AssertCheck(lastError != NULL,
  367. "SDL_GetError() != NULL");
  368. if (lastError != NULL) {
  369. len = SDL_strlen(lastError);
  370. SDLTest_AssertCheck(len == SDL_strlen(probeError),
  371. "SDL_GetError(): expected message len %i, was len: %i",
  372. (int)SDL_strlen(probeError),
  373. (int)len);
  374. SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0,
  375. "SDL_GetError(): expected message '%s', was message: '%s'",
  376. probeError,
  377. lastError);
  378. }
  379. /* Clean up */
  380. SDL_ClearError();
  381. SDLTest_AssertPass("SDL_ClearError()");
  382. return TEST_COMPLETED;
  383. }
  384. #if defined(HAVE_WFORMAT_OVERFLOW)
  385. #pragma GCC diagnostic pop
  386. #endif
  387. /* !
  388. * \brief Tests SDL_GetPowerInfo
  389. * \sa
  390. * http://wiki.libsdl.org/SDL_GetPowerInfo
  391. */
  392. int platform_testGetPowerInfo(void *arg)
  393. {
  394. SDL_PowerState state;
  395. SDL_PowerState stateAgain;
  396. int secs;
  397. int secsAgain;
  398. int pct;
  399. int pctAgain;
  400. state = SDL_GetPowerInfo(&secs, &pct);
  401. SDLTest_AssertPass("SDL_GetPowerInfo()");
  402. SDLTest_AssertCheck(
  403. state == SDL_POWERSTATE_UNKNOWN ||
  404. state == SDL_POWERSTATE_ON_BATTERY ||
  405. state == SDL_POWERSTATE_NO_BATTERY ||
  406. state == SDL_POWERSTATE_CHARGING ||
  407. state == SDL_POWERSTATE_CHARGED,
  408. "SDL_GetPowerInfo(): state %i is one of the expected values",
  409. (int)state);
  410. if (state == SDL_POWERSTATE_ON_BATTERY) {
  411. SDLTest_AssertCheck(
  412. secs >= 0,
  413. "SDL_GetPowerInfo(): on battery, secs >= 0, was: %i",
  414. secs);
  415. SDLTest_AssertCheck(
  416. (pct >= 0) && (pct <= 100),
  417. "SDL_GetPowerInfo(): on battery, pct=[0,100], was: %i",
  418. pct);
  419. }
  420. if (state == SDL_POWERSTATE_UNKNOWN ||
  421. state == SDL_POWERSTATE_NO_BATTERY) {
  422. SDLTest_AssertCheck(
  423. secs == -1,
  424. "SDL_GetPowerInfo(): no battery, secs == -1, was: %i",
  425. secs);
  426. SDLTest_AssertCheck(
  427. pct == -1,
  428. "SDL_GetPowerInfo(): no battery, pct == -1, was: %i",
  429. pct);
  430. }
  431. /* Partial return value variations */
  432. stateAgain = SDL_GetPowerInfo(&secsAgain, NULL);
  433. SDLTest_AssertCheck(
  434. state == stateAgain,
  435. "State %i returned when only 'secs' requested",
  436. stateAgain);
  437. SDLTest_AssertCheck(
  438. secs == secsAgain,
  439. "Value %i matches when only 'secs' requested",
  440. secsAgain);
  441. stateAgain = SDL_GetPowerInfo(NULL, &pctAgain);
  442. SDLTest_AssertCheck(
  443. state == stateAgain,
  444. "State %i returned when only 'pct' requested",
  445. stateAgain);
  446. SDLTest_AssertCheck(
  447. pct == pctAgain,
  448. "Value %i matches when only 'pct' requested",
  449. pctAgain);
  450. stateAgain = SDL_GetPowerInfo(NULL, NULL);
  451. SDLTest_AssertCheck(
  452. state == stateAgain,
  453. "State %i returned when no value requested",
  454. stateAgain);
  455. return TEST_COMPLETED;
  456. }
  457. /* ================= Test References ================== */
  458. /* Platform test cases */
  459. static const SDLTest_TestCaseReference platformTest1 = {
  460. (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED
  461. };
  462. static const SDLTest_TestCaseReference platformTest2 = {
  463. (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianness and swap functions", TEST_ENABLED
  464. };
  465. static const SDLTest_TestCaseReference platformTest3 = {
  466. (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED
  467. };
  468. static const SDLTest_TestCaseReference platformTest4 = {
  469. (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED
  470. };
  471. static const SDLTest_TestCaseReference platformTest5 = {
  472. (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED
  473. };
  474. static const SDLTest_TestCaseReference platformTest6 = {
  475. (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED
  476. };
  477. static const SDLTest_TestCaseReference platformTest7 = {
  478. (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED
  479. };
  480. static const SDLTest_TestCaseReference platformTest8 = {
  481. (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED
  482. };
  483. static const SDLTest_TestCaseReference platformTest9 = {
  484. (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED
  485. };
  486. static const SDLTest_TestCaseReference platformTest10 = {
  487. (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED
  488. };
  489. static const SDLTest_TestCaseReference platformTest11 = {
  490. (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED
  491. };
  492. /* Sequence of Platform test cases */
  493. static const SDLTest_TestCaseReference *platformTests[] = {
  494. &platformTest1,
  495. &platformTest2,
  496. &platformTest3,
  497. &platformTest4,
  498. &platformTest5,
  499. &platformTest6,
  500. &platformTest7,
  501. &platformTest8,
  502. &platformTest9,
  503. &platformTest10,
  504. &platformTest11,
  505. NULL
  506. };
  507. /* Platform test suite (global) */
  508. SDLTest_TestSuiteReference platformTestSuite = {
  509. "Platform",
  510. NULL,
  511. platformTests,
  512. NULL
  513. };