testautomation_platform.c 18 KB

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