testautomation_platform.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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_Has3DNow
  140. * http://wiki.libsdl.org/SDL_HasAltiVec
  141. * http://wiki.libsdl.org/SDL_HasMMX
  142. * http://wiki.libsdl.org/SDL_HasRDTSC
  143. * http://wiki.libsdl.org/SDL_HasSSE
  144. * http://wiki.libsdl.org/SDL_HasSSE2
  145. * http://wiki.libsdl.org/SDL_HasSSE3
  146. * http://wiki.libsdl.org/SDL_HasSSE41
  147. * http://wiki.libsdl.org/SDL_HasSSE42
  148. * http://wiki.libsdl.org/SDL_HasAVX
  149. */
  150. int platform_testHasFunctions(void *arg)
  151. {
  152. /* TODO: independently determine and compare values as well */
  153. SDL_HasRDTSC();
  154. SDLTest_AssertPass("SDL_HasRDTSC()");
  155. SDL_HasAltiVec();
  156. SDLTest_AssertPass("SDL_HasAltiVec()");
  157. SDL_HasMMX();
  158. SDLTest_AssertPass("SDL_HasMMX()");
  159. SDL_Has3DNow();
  160. SDLTest_AssertPass("SDL_Has3DNow()");
  161. SDL_HasSSE();
  162. SDLTest_AssertPass("SDL_HasSSE()");
  163. SDL_HasSSE2();
  164. SDLTest_AssertPass("SDL_HasSSE2()");
  165. SDL_HasSSE3();
  166. SDLTest_AssertPass("SDL_HasSSE3()");
  167. SDL_HasSSE41();
  168. SDLTest_AssertPass("SDL_HasSSE41()");
  169. SDL_HasSSE42();
  170. SDLTest_AssertPass("SDL_HasSSE42()");
  171. SDL_HasAVX();
  172. SDLTest_AssertPass("SDL_HasAVX()");
  173. return TEST_COMPLETED;
  174. }
  175. /* !
  176. * \brief Tests SDL_GetVersion
  177. * \sa
  178. * http://wiki.libsdl.org/SDL_GetVersion
  179. */
  180. int platform_testGetVersion(void *arg)
  181. {
  182. SDL_version linked;
  183. int major = SDL_MAJOR_VERSION;
  184. int minor = SDL_MINOR_VERSION;
  185. SDL_GetVersion(&linked);
  186. SDLTest_AssertCheck(linked.major >= major,
  187. "SDL_GetVersion(): returned major %i (>= %i)",
  188. linked.major,
  189. major);
  190. SDLTest_AssertCheck(linked.minor >= minor,
  191. "SDL_GetVersion(): returned minor %i (>= %i)",
  192. linked.minor,
  193. minor);
  194. return TEST_COMPLETED;
  195. }
  196. /* !
  197. * \brief Tests SDL_VERSION macro
  198. */
  199. int platform_testSDLVersion(void *arg)
  200. {
  201. SDL_version compiled;
  202. int major = SDL_MAJOR_VERSION;
  203. int minor = SDL_MINOR_VERSION;
  204. SDL_VERSION(&compiled);
  205. SDLTest_AssertCheck(compiled.major >= major,
  206. "SDL_VERSION() returned major %i (>= %i)",
  207. compiled.major,
  208. major);
  209. SDLTest_AssertCheck(compiled.minor >= minor,
  210. "SDL_VERSION() returned minor %i (>= %i)",
  211. compiled.minor,
  212. minor);
  213. return TEST_COMPLETED;
  214. }
  215. /* !
  216. * \brief Tests default SDL_Init
  217. */
  218. int platform_testDefaultInit(void *arg)
  219. {
  220. int ret;
  221. int subsystem;
  222. subsystem = SDL_WasInit(SDL_INIT_EVERYTHING);
  223. SDLTest_AssertCheck(subsystem != 0,
  224. "SDL_WasInit(0): returned %i, expected != 0",
  225. subsystem);
  226. ret = SDL_Init(SDL_WasInit(SDL_INIT_EVERYTHING));
  227. SDLTest_AssertCheck(ret == 0,
  228. "SDL_Init(0): returned %i, expected 0, error: %s",
  229. ret,
  230. SDL_GetError());
  231. return TEST_COMPLETED;
  232. }
  233. /* !
  234. * \brief Tests SDL_Get/Set/ClearError
  235. * \sa
  236. * http://wiki.libsdl.org/SDL_GetError
  237. * http://wiki.libsdl.org/SDL_SetError
  238. * http://wiki.libsdl.org/SDL_ClearError
  239. */
  240. int platform_testGetSetClearError(void *arg)
  241. {
  242. int result;
  243. const char *testError = "Testing";
  244. char *lastError;
  245. size_t len;
  246. SDL_ClearError();
  247. SDLTest_AssertPass("SDL_ClearError()");
  248. lastError = (char *)SDL_GetError();
  249. SDLTest_AssertPass("SDL_GetError()");
  250. SDLTest_AssertCheck(lastError != NULL,
  251. "SDL_GetError() != NULL");
  252. if (lastError != NULL) {
  253. len = SDL_strlen(lastError);
  254. SDLTest_AssertCheck(len == 0,
  255. "SDL_GetError(): no message expected, len: %i", (int)len);
  256. }
  257. result = SDL_SetError("%s", testError);
  258. SDLTest_AssertPass("SDL_SetError()");
  259. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  260. lastError = (char *)SDL_GetError();
  261. SDLTest_AssertCheck(lastError != NULL,
  262. "SDL_GetError() != NULL");
  263. if (lastError != NULL) {
  264. len = SDL_strlen(lastError);
  265. SDLTest_AssertCheck(len == SDL_strlen(testError),
  266. "SDL_GetError(): expected message len %i, was len: %i",
  267. (int)SDL_strlen(testError),
  268. (int)len);
  269. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  270. "SDL_GetError(): expected message %s, was message: %s",
  271. testError,
  272. lastError);
  273. }
  274. /* Clean up */
  275. SDL_ClearError();
  276. SDLTest_AssertPass("SDL_ClearError()");
  277. return TEST_COMPLETED;
  278. }
  279. /* !
  280. * \brief Tests SDL_SetError with empty input
  281. * \sa
  282. * http://wiki.libsdl.org/SDL_SetError
  283. */
  284. int platform_testSetErrorEmptyInput(void *arg)
  285. {
  286. int result;
  287. const char *testError = "";
  288. char *lastError;
  289. size_t len;
  290. result = SDL_SetError("%s", testError);
  291. SDLTest_AssertPass("SDL_SetError()");
  292. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  293. lastError = (char *)SDL_GetError();
  294. SDLTest_AssertCheck(lastError != NULL,
  295. "SDL_GetError() != NULL");
  296. if (lastError != NULL) {
  297. len = SDL_strlen(lastError);
  298. SDLTest_AssertCheck(len == SDL_strlen(testError),
  299. "SDL_GetError(): expected message len %i, was len: %i",
  300. (int)SDL_strlen(testError),
  301. (int)len);
  302. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  303. "SDL_GetError(): expected message '%s', was message: '%s'",
  304. testError,
  305. lastError);
  306. }
  307. /* Clean up */
  308. SDL_ClearError();
  309. SDLTest_AssertPass("SDL_ClearError()");
  310. return TEST_COMPLETED;
  311. }
  312. #if defined(HAVE_WFORMAT_OVERFLOW)
  313. #pragma GCC diagnostic push
  314. #pragma GCC diagnostic ignored "-Wformat-overflow"
  315. #endif
  316. /* !
  317. * \brief Tests SDL_SetError with invalid input
  318. * \sa
  319. * http://wiki.libsdl.org/SDL_SetError
  320. */
  321. int platform_testSetErrorInvalidInput(void *arg)
  322. {
  323. int result;
  324. const char *invalidError = NULL;
  325. const char *probeError = "Testing";
  326. char *lastError;
  327. size_t len;
  328. /* Reset */
  329. SDL_ClearError();
  330. SDLTest_AssertPass("SDL_ClearError()");
  331. /* Check for no-op */
  332. result = SDL_SetError("%s", invalidError);
  333. SDLTest_AssertPass("SDL_SetError()");
  334. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  335. lastError = (char *)SDL_GetError();
  336. SDLTest_AssertCheck(lastError != NULL,
  337. "SDL_GetError() != NULL");
  338. if (lastError != NULL) {
  339. len = SDL_strlen(lastError);
  340. SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0,
  341. "SDL_GetError(): expected message len 0, was len: %i",
  342. (int)len);
  343. }
  344. /* Set */
  345. result = SDL_SetError("%s", probeError);
  346. SDLTest_AssertPass("SDL_SetError('%s')", probeError);
  347. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  348. /* Check for no-op */
  349. result = SDL_SetError("%s", invalidError);
  350. SDLTest_AssertPass("SDL_SetError(NULL)");
  351. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  352. lastError = (char *)SDL_GetError();
  353. SDLTest_AssertCheck(lastError != NULL,
  354. "SDL_GetError() != NULL");
  355. if (lastError != NULL) {
  356. len = SDL_strlen(lastError);
  357. SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0,
  358. "SDL_GetError(): expected message len 0, was len: %i",
  359. (int)len);
  360. }
  361. /* Reset */
  362. SDL_ClearError();
  363. SDLTest_AssertPass("SDL_ClearError()");
  364. /* Set and check */
  365. result = SDL_SetError("%s", probeError);
  366. SDLTest_AssertPass("SDL_SetError()");
  367. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  368. lastError = (char *)SDL_GetError();
  369. SDLTest_AssertCheck(lastError != NULL,
  370. "SDL_GetError() != NULL");
  371. if (lastError != NULL) {
  372. len = SDL_strlen(lastError);
  373. SDLTest_AssertCheck(len == SDL_strlen(probeError),
  374. "SDL_GetError(): expected message len %i, was len: %i",
  375. (int)SDL_strlen(probeError),
  376. (int)len);
  377. SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0,
  378. "SDL_GetError(): expected message '%s', was message: '%s'",
  379. probeError,
  380. lastError);
  381. }
  382. /* Clean up */
  383. SDL_ClearError();
  384. SDLTest_AssertPass("SDL_ClearError()");
  385. return TEST_COMPLETED;
  386. }
  387. #if defined(HAVE_WFORMAT_OVERFLOW)
  388. #pragma GCC diagnostic pop
  389. #endif
  390. /* !
  391. * \brief Tests SDL_GetPowerInfo
  392. * \sa
  393. * http://wiki.libsdl.org/SDL_GetPowerInfo
  394. */
  395. int platform_testGetPowerInfo(void *arg)
  396. {
  397. SDL_PowerState state;
  398. SDL_PowerState stateAgain;
  399. int secs;
  400. int secsAgain;
  401. int pct;
  402. int pctAgain;
  403. state = SDL_GetPowerInfo(&secs, &pct);
  404. SDLTest_AssertPass("SDL_GetPowerInfo()");
  405. SDLTest_AssertCheck(
  406. state == SDL_POWERSTATE_UNKNOWN ||
  407. state == SDL_POWERSTATE_ON_BATTERY ||
  408. state == SDL_POWERSTATE_NO_BATTERY ||
  409. state == SDL_POWERSTATE_CHARGING ||
  410. state == SDL_POWERSTATE_CHARGED,
  411. "SDL_GetPowerInfo(): state %i is one of the expected values",
  412. (int)state);
  413. if (state == SDL_POWERSTATE_ON_BATTERY) {
  414. SDLTest_AssertCheck(
  415. secs >= 0,
  416. "SDL_GetPowerInfo(): on battery, secs >= 0, was: %i",
  417. secs);
  418. SDLTest_AssertCheck(
  419. (pct >= 0) && (pct <= 100),
  420. "SDL_GetPowerInfo(): on battery, pct=[0,100], was: %i",
  421. pct);
  422. }
  423. if (state == SDL_POWERSTATE_UNKNOWN ||
  424. state == SDL_POWERSTATE_NO_BATTERY) {
  425. SDLTest_AssertCheck(
  426. secs == -1,
  427. "SDL_GetPowerInfo(): no battery, secs == -1, was: %i",
  428. secs);
  429. SDLTest_AssertCheck(
  430. pct == -1,
  431. "SDL_GetPowerInfo(): no battery, pct == -1, was: %i",
  432. pct);
  433. }
  434. /* Partial return value variations */
  435. stateAgain = SDL_GetPowerInfo(&secsAgain, NULL);
  436. SDLTest_AssertCheck(
  437. state == stateAgain,
  438. "State %i returned when only 'secs' requested",
  439. stateAgain);
  440. SDLTest_AssertCheck(
  441. secs == secsAgain,
  442. "Value %i matches when only 'secs' requested",
  443. secsAgain);
  444. stateAgain = SDL_GetPowerInfo(NULL, &pctAgain);
  445. SDLTest_AssertCheck(
  446. state == stateAgain,
  447. "State %i returned when only 'pct' requested",
  448. stateAgain);
  449. SDLTest_AssertCheck(
  450. pct == pctAgain,
  451. "Value %i matches when only 'pct' requested",
  452. pctAgain);
  453. stateAgain = SDL_GetPowerInfo(NULL, NULL);
  454. SDLTest_AssertCheck(
  455. state == stateAgain,
  456. "State %i returned when no value requested",
  457. stateAgain);
  458. return TEST_COMPLETED;
  459. }
  460. /* ================= Test References ================== */
  461. /* Platform test cases */
  462. static const SDLTest_TestCaseReference platformTest1 = {
  463. (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED
  464. };
  465. static const SDLTest_TestCaseReference platformTest2 = {
  466. (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianness and swap functions", TEST_ENABLED
  467. };
  468. static const SDLTest_TestCaseReference platformTest3 = {
  469. (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED
  470. };
  471. static const SDLTest_TestCaseReference platformTest4 = {
  472. (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED
  473. };
  474. static const SDLTest_TestCaseReference platformTest5 = {
  475. (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED
  476. };
  477. static const SDLTest_TestCaseReference platformTest6 = {
  478. (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED
  479. };
  480. static const SDLTest_TestCaseReference platformTest7 = {
  481. (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED
  482. };
  483. static const SDLTest_TestCaseReference platformTest8 = {
  484. (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED
  485. };
  486. static const SDLTest_TestCaseReference platformTest9 = {
  487. (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED
  488. };
  489. static const SDLTest_TestCaseReference platformTest10 = {
  490. (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED
  491. };
  492. static const SDLTest_TestCaseReference platformTest11 = {
  493. (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED
  494. };
  495. /* Sequence of Platform test cases */
  496. static const SDLTest_TestCaseReference *platformTests[] = {
  497. &platformTest1,
  498. &platformTest2,
  499. &platformTest3,
  500. &platformTest4,
  501. &platformTest5,
  502. &platformTest6,
  503. &platformTest7,
  504. &platformTest8,
  505. &platformTest9,
  506. &platformTest10,
  507. &platformTest11,
  508. NULL
  509. };
  510. /* Platform test suite (global) */
  511. SDLTest_TestSuiteReference platformTestSuite = {
  512. "Platform",
  513. NULL,
  514. platformTests,
  515. NULL
  516. };
  517. /* vi: set ts=4 sw=4 expandtab: */