testautomation_platform.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598
  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 <stdio.h>
  6. #include "SDL.h"
  7. #include "SDL_test.h"
  8. /* ================= Test Case Implementation ================== */
  9. /* Helper functions */
  10. /**
  11. * @brief Compare sizes of types.
  12. *
  13. * @note Watcom C flags these as Warning 201: "Unreachable code" if you just
  14. * compare them directly, so we push it through a function to keep the
  15. * compiler quiet. --ryan.
  16. */
  17. static int _compareSizeOfType( size_t sizeoftype, size_t hardcodetype )
  18. {
  19. return sizeoftype != hardcodetype;
  20. }
  21. /* Test case functions */
  22. /**
  23. * @brief Tests type sizes.
  24. */
  25. int platform_testTypes(void *arg)
  26. {
  27. int ret;
  28. ret = _compareSizeOfType( sizeof(Uint8), 1 );
  29. SDLTest_AssertCheck( ret == 0, "sizeof(Uint8) = %lu, expected 1", (unsigned long)sizeof(Uint8) );
  30. ret = _compareSizeOfType( sizeof(Uint16), 2 );
  31. SDLTest_AssertCheck( ret == 0, "sizeof(Uint16) = %lu, expected 2", (unsigned long)sizeof(Uint16) );
  32. ret = _compareSizeOfType( sizeof(Uint32), 4 );
  33. SDLTest_AssertCheck( ret == 0, "sizeof(Uint32) = %lu, expected 4", (unsigned long)sizeof(Uint32) );
  34. ret = _compareSizeOfType( sizeof(Uint64), 8 );
  35. SDLTest_AssertCheck( ret == 0, "sizeof(Uint64) = %lu, expected 8", (unsigned long)sizeof(Uint64) );
  36. return TEST_COMPLETED;
  37. }
  38. /**
  39. * @brief Tests platform endianness and SDL_SwapXY functions.
  40. */
  41. int platform_testEndianessAndSwap(void *arg)
  42. {
  43. int real_byteorder;
  44. int real_floatwordorder = 0;
  45. Uint16 value = 0x1234;
  46. Uint16 value16 = 0xCDAB;
  47. Uint16 swapped16 = 0xABCD;
  48. Uint32 value32 = 0xEFBEADDE;
  49. Uint32 swapped32 = 0xDEADBEEF;
  50. union {
  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" : "unknown" );
  82. /* Test 16 swap. */
  83. SDLTest_AssertCheck( SDL_Swap16(value16) == swapped16,
  84. "SDL_Swap16(): 16 bit swapped: 0x%X => 0x%X",
  85. value16, SDL_Swap16(value16) );
  86. /* Test 32 swap. */
  87. SDLTest_AssertCheck( SDL_Swap32(value32) == swapped32,
  88. "SDL_Swap32(): 32 bit swapped: 0x%X => 0x%X",
  89. value32, SDL_Swap32(value32) );
  90. /* Test 64 swap. */
  91. SDLTest_AssertCheck( SDL_Swap64(value64) == swapped64,
  92. "SDL_Swap64(): 64 bit swapped: 0x%"SDL_PRIX64" => 0x%"SDL_PRIX64,
  93. value64, SDL_Swap64(value64) );
  94. return TEST_COMPLETED;
  95. }
  96. /* !
  97. * \brief Tests SDL_GetXYZ() functions
  98. * \sa
  99. * http://wiki.libsdl.org/SDL_GetPlatform
  100. * http://wiki.libsdl.org/SDL_GetCPUCount
  101. * http://wiki.libsdl.org/SDL_GetCPUCacheLineSize
  102. * http://wiki.libsdl.org/SDL_GetRevision
  103. * http://wiki.libsdl.org/SDL_GetRevisionNumber
  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. {
  254. len = SDL_strlen(lastError);
  255. SDLTest_AssertCheck(len == 0,
  256. "SDL_GetError(): no message expected, len: %i", (int) len);
  257. }
  258. result = SDL_SetError("%s", testError);
  259. SDLTest_AssertPass("SDL_SetError()");
  260. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  261. lastError = (char *)SDL_GetError();
  262. SDLTest_AssertCheck(lastError != NULL,
  263. "SDL_GetError() != NULL");
  264. if (lastError != NULL)
  265. {
  266. len = SDL_strlen(lastError);
  267. SDLTest_AssertCheck(len == SDL_strlen(testError),
  268. "SDL_GetError(): expected message len %i, was len: %i",
  269. (int) SDL_strlen(testError),
  270. (int) len);
  271. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  272. "SDL_GetError(): expected message %s, was message: %s",
  273. testError,
  274. lastError);
  275. }
  276. /* Clean up */
  277. SDL_ClearError();
  278. SDLTest_AssertPass("SDL_ClearError()");
  279. return TEST_COMPLETED;
  280. }
  281. /* !
  282. * \brief Tests SDL_SetError with empty input
  283. * \sa
  284. * http://wiki.libsdl.org/SDL_SetError
  285. */
  286. int platform_testSetErrorEmptyInput(void *arg)
  287. {
  288. int result;
  289. const char *testError = "";
  290. char *lastError;
  291. size_t len;
  292. result = SDL_SetError("%s", testError);
  293. SDLTest_AssertPass("SDL_SetError()");
  294. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  295. lastError = (char *)SDL_GetError();
  296. SDLTest_AssertCheck(lastError != NULL,
  297. "SDL_GetError() != NULL");
  298. if (lastError != NULL)
  299. {
  300. len = SDL_strlen(lastError);
  301. SDLTest_AssertCheck(len == SDL_strlen(testError),
  302. "SDL_GetError(): expected message len %i, was len: %i",
  303. (int) SDL_strlen(testError),
  304. (int) len);
  305. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  306. "SDL_GetError(): expected message '%s', was message: '%s'",
  307. testError,
  308. lastError);
  309. }
  310. /* Clean up */
  311. SDL_ClearError();
  312. SDLTest_AssertPass("SDL_ClearError()");
  313. return TEST_COMPLETED;
  314. }
  315. /* !
  316. * \brief Tests SDL_SetError with invalid input
  317. * \sa
  318. * http://wiki.libsdl.org/SDL_SetError
  319. */
  320. int platform_testSetErrorInvalidInput(void *arg)
  321. {
  322. int result;
  323. const char *invalidError = NULL;
  324. const char *probeError = "Testing";
  325. char *lastError;
  326. size_t len;
  327. /* Reset */
  328. SDL_ClearError();
  329. SDLTest_AssertPass("SDL_ClearError()");
  330. /* Check for no-op */
  331. result = SDL_SetError("%s", invalidError);
  332. SDLTest_AssertPass("SDL_SetError()");
  333. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  334. lastError = (char *)SDL_GetError();
  335. SDLTest_AssertCheck(lastError != NULL,
  336. "SDL_GetError() != NULL");
  337. if (lastError != NULL)
  338. {
  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. {
  357. len = SDL_strlen(lastError);
  358. SDLTest_AssertCheck(len == 0 || SDL_strcmp( lastError, "(null)" ) == 0,
  359. "SDL_GetError(): expected message len 0, was len: %i",
  360. (int) len);
  361. }
  362. /* Reset */
  363. SDL_ClearError();
  364. SDLTest_AssertPass("SDL_ClearError()");
  365. /* Set and check */
  366. result = SDL_SetError("%s", probeError);
  367. SDLTest_AssertPass("SDL_SetError()");
  368. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  369. lastError = (char *)SDL_GetError();
  370. SDLTest_AssertCheck(lastError != NULL,
  371. "SDL_GetError() != NULL");
  372. if (lastError != NULL)
  373. {
  374. len = SDL_strlen(lastError);
  375. SDLTest_AssertCheck(len == SDL_strlen(probeError),
  376. "SDL_GetError(): expected message len %i, was len: %i",
  377. (int) SDL_strlen(probeError),
  378. (int) len);
  379. SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0,
  380. "SDL_GetError(): expected message '%s', was message: '%s'",
  381. probeError,
  382. lastError);
  383. }
  384. /* Clean up */
  385. SDL_ClearError();
  386. SDLTest_AssertPass("SDL_ClearError()");
  387. return TEST_COMPLETED;
  388. }
  389. /* !
  390. * \brief Tests SDL_GetPowerInfo
  391. * \sa
  392. * http://wiki.libsdl.org/SDL_GetPowerInfo
  393. */
  394. int platform_testGetPowerInfo(void *arg)
  395. {
  396. SDL_PowerState state;
  397. SDL_PowerState stateAgain;
  398. int secs;
  399. int secsAgain;
  400. int pct;
  401. int pctAgain;
  402. state = SDL_GetPowerInfo(&secs, &pct);
  403. SDLTest_AssertPass("SDL_GetPowerInfo()");
  404. SDLTest_AssertCheck(
  405. state==SDL_POWERSTATE_UNKNOWN ||
  406. state==SDL_POWERSTATE_ON_BATTERY ||
  407. state==SDL_POWERSTATE_NO_BATTERY ||
  408. state==SDL_POWERSTATE_CHARGING ||
  409. state==SDL_POWERSTATE_CHARGED,
  410. "SDL_GetPowerInfo(): state %i is one of the expected values",
  411. (int)state);
  412. if (state==SDL_POWERSTATE_ON_BATTERY)
  413. {
  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. {
  426. SDLTest_AssertCheck(
  427. secs == -1,
  428. "SDL_GetPowerInfo(): no battery, secs == -1, was: %i",
  429. secs);
  430. SDLTest_AssertCheck(
  431. pct == -1,
  432. "SDL_GetPowerInfo(): no battery, pct == -1, was: %i",
  433. pct);
  434. }
  435. /* Partial return value variations */
  436. stateAgain = SDL_GetPowerInfo(&secsAgain, NULL);
  437. SDLTest_AssertCheck(
  438. state==stateAgain,
  439. "State %i returned when only 'secs' requested",
  440. stateAgain);
  441. SDLTest_AssertCheck(
  442. secs==secsAgain,
  443. "Value %i matches when only 'secs' requested",
  444. secsAgain);
  445. stateAgain = SDL_GetPowerInfo(NULL, &pctAgain);
  446. SDLTest_AssertCheck(
  447. state==stateAgain,
  448. "State %i returned when only 'pct' requested",
  449. stateAgain);
  450. SDLTest_AssertCheck(
  451. pct==pctAgain,
  452. "Value %i matches when only 'pct' requested",
  453. pctAgain);
  454. stateAgain = SDL_GetPowerInfo(NULL, NULL);
  455. SDLTest_AssertCheck(
  456. state==stateAgain,
  457. "State %i returned when no value requested",
  458. stateAgain);
  459. return TEST_COMPLETED;
  460. }
  461. /* ================= Test References ================== */
  462. /* Platform test cases */
  463. static const SDLTest_TestCaseReference platformTest1 =
  464. { (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED};
  465. static const SDLTest_TestCaseReference platformTest2 =
  466. { (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianness and swap functions", TEST_ENABLED};
  467. static const SDLTest_TestCaseReference platformTest3 =
  468. { (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED};
  469. static const SDLTest_TestCaseReference platformTest4 =
  470. { (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED};
  471. static const SDLTest_TestCaseReference platformTest5 =
  472. { (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED};
  473. static const SDLTest_TestCaseReference platformTest6 =
  474. { (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED};
  475. static const SDLTest_TestCaseReference platformTest7 =
  476. { (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED};
  477. static const SDLTest_TestCaseReference platformTest8 =
  478. { (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED};
  479. static const SDLTest_TestCaseReference platformTest9 =
  480. { (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED};
  481. static const SDLTest_TestCaseReference platformTest10 =
  482. { (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED};
  483. static const SDLTest_TestCaseReference platformTest11 =
  484. { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED };
  485. /* Sequence of Platform test cases */
  486. static const SDLTest_TestCaseReference *platformTests[] = {
  487. &platformTest1,
  488. &platformTest2,
  489. &platformTest3,
  490. &platformTest4,
  491. &platformTest5,
  492. &platformTest6,
  493. &platformTest7,
  494. &platformTest8,
  495. &platformTest9,
  496. &platformTest10,
  497. &platformTest11,
  498. NULL
  499. };
  500. /* Platform test suite (global) */
  501. SDLTest_TestSuiteReference platformTestSuite = {
  502. "Platform",
  503. NULL,
  504. platformTests,
  505. NULL
  506. };