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 <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) = %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. len = SDL_strlen(lastError);
  252. SDLTest_AssertCheck(len == 0,
  253. "SDL_GetError(): no message expected, len: %i", (int) len);
  254. }
  255. result = SDL_SetError("%s", testError);
  256. SDLTest_AssertPass("SDL_SetError()");
  257. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  258. lastError = (char *)SDL_GetError();
  259. SDLTest_AssertCheck(lastError != NULL,
  260. "SDL_GetError() != NULL");
  261. if (lastError != NULL) {
  262. len = SDL_strlen(lastError);
  263. SDLTest_AssertCheck(len == SDL_strlen(testError),
  264. "SDL_GetError(): expected message len %i, was len: %i",
  265. (int) SDL_strlen(testError),
  266. (int) len);
  267. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  268. "SDL_GetError(): expected message %s, was message: %s",
  269. testError,
  270. lastError);
  271. }
  272. /* Clean up */
  273. SDL_ClearError();
  274. SDLTest_AssertPass("SDL_ClearError()");
  275. return TEST_COMPLETED;
  276. }
  277. /* !
  278. * \brief Tests SDL_SetError with empty input
  279. * \sa
  280. * http://wiki.libsdl.org/SDL_SetError
  281. */
  282. int platform_testSetErrorEmptyInput(void *arg)
  283. {
  284. int result;
  285. const char *testError = "";
  286. char *lastError;
  287. size_t len;
  288. result = SDL_SetError("%s", testError);
  289. SDLTest_AssertPass("SDL_SetError()");
  290. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  291. lastError = (char *)SDL_GetError();
  292. SDLTest_AssertCheck(lastError != NULL,
  293. "SDL_GetError() != NULL");
  294. if (lastError != NULL) {
  295. len = SDL_strlen(lastError);
  296. SDLTest_AssertCheck(len == SDL_strlen(testError),
  297. "SDL_GetError(): expected message len %i, was len: %i",
  298. (int) SDL_strlen(testError),
  299. (int) len);
  300. SDLTest_AssertCheck(SDL_strcmp(lastError, testError) == 0,
  301. "SDL_GetError(): expected message '%s', was message: '%s'",
  302. testError,
  303. lastError);
  304. }
  305. /* Clean up */
  306. SDL_ClearError();
  307. SDLTest_AssertPass("SDL_ClearError()");
  308. return TEST_COMPLETED;
  309. }
  310. #if defined(HAVE_WFORMAT_OVERFLOW)
  311. #pragma GCC diagnostic push
  312. #pragma GCC diagnostic ignored "-Wformat-overflow"
  313. #endif
  314. /* !
  315. * \brief Tests SDL_SetError with invalid input
  316. * \sa
  317. * http://wiki.libsdl.org/SDL_SetError
  318. */
  319. int platform_testSetErrorInvalidInput(void *arg)
  320. {
  321. int result;
  322. const char *invalidError = NULL;
  323. const char *probeError = "Testing";
  324. char *lastError;
  325. size_t len;
  326. /* Reset */
  327. SDL_ClearError();
  328. SDLTest_AssertPass("SDL_ClearError()");
  329. /* Check for no-op */
  330. result = SDL_SetError("%s", invalidError);
  331. SDLTest_AssertPass("SDL_SetError()");
  332. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  333. lastError = (char *)SDL_GetError();
  334. SDLTest_AssertCheck(lastError != NULL,
  335. "SDL_GetError() != NULL");
  336. if (lastError != NULL) {
  337. len = SDL_strlen(lastError);
  338. SDLTest_AssertCheck(len == 0 || SDL_strcmp(lastError, "(null)") == 0,
  339. "SDL_GetError(): expected message len 0, was len: %i",
  340. (int) len);
  341. }
  342. /* Set */
  343. result = SDL_SetError("%s", probeError);
  344. SDLTest_AssertPass("SDL_SetError('%s')", probeError);
  345. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  346. /* Check for no-op */
  347. result = SDL_SetError("%s", invalidError);
  348. SDLTest_AssertPass("SDL_SetError(NULL)");
  349. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  350. lastError = (char *)SDL_GetError();
  351. SDLTest_AssertCheck(lastError != NULL,
  352. "SDL_GetError() != NULL");
  353. if (lastError != NULL) {
  354. len = SDL_strlen(lastError);
  355. SDLTest_AssertCheck(len == 0 || SDL_strcmp( lastError, "(null)" ) == 0,
  356. "SDL_GetError(): expected message len 0, was len: %i",
  357. (int) len);
  358. }
  359. /* Reset */
  360. SDL_ClearError();
  361. SDLTest_AssertPass("SDL_ClearError()");
  362. /* Set and check */
  363. result = SDL_SetError("%s", probeError);
  364. SDLTest_AssertPass("SDL_SetError()");
  365. SDLTest_AssertCheck(result == -1, "SDL_SetError: expected -1, got: %i", result);
  366. lastError = (char *)SDL_GetError();
  367. SDLTest_AssertCheck(lastError != NULL,
  368. "SDL_GetError() != NULL");
  369. if (lastError != NULL) {
  370. len = SDL_strlen(lastError);
  371. SDLTest_AssertCheck(len == SDL_strlen(probeError),
  372. "SDL_GetError(): expected message len %i, was len: %i",
  373. (int) SDL_strlen(probeError),
  374. (int) len);
  375. SDLTest_AssertCheck(SDL_strcmp(lastError, probeError) == 0,
  376. "SDL_GetError(): expected message '%s', was message: '%s'",
  377. probeError,
  378. lastError);
  379. }
  380. /* Clean up */
  381. SDL_ClearError();
  382. SDLTest_AssertPass("SDL_ClearError()");
  383. return TEST_COMPLETED;
  384. }
  385. #if defined(HAVE_WFORMAT_OVERFLOW)
  386. #pragma GCC diagnostic pop
  387. #endif
  388. /* !
  389. * \brief Tests SDL_GetPowerInfo
  390. * \sa
  391. * http://wiki.libsdl.org/SDL_GetPowerInfo
  392. */
  393. int platform_testGetPowerInfo(void *arg)
  394. {
  395. SDL_PowerState state;
  396. SDL_PowerState stateAgain;
  397. int secs;
  398. int secsAgain;
  399. int pct;
  400. int pctAgain;
  401. state = SDL_GetPowerInfo(&secs, &pct);
  402. SDLTest_AssertPass("SDL_GetPowerInfo()");
  403. SDLTest_AssertCheck(
  404. state==SDL_POWERSTATE_UNKNOWN ||
  405. state==SDL_POWERSTATE_ON_BATTERY ||
  406. state==SDL_POWERSTATE_NO_BATTERY ||
  407. state==SDL_POWERSTATE_CHARGING ||
  408. state==SDL_POWERSTATE_CHARGED,
  409. "SDL_GetPowerInfo(): state %i is one of the expected values",
  410. (int)state);
  411. if (state==SDL_POWERSTATE_ON_BATTERY) {
  412. SDLTest_AssertCheck(
  413. secs >= 0,
  414. "SDL_GetPowerInfo(): on battery, secs >= 0, was: %i",
  415. secs);
  416. SDLTest_AssertCheck(
  417. (pct >= 0) && (pct <= 100),
  418. "SDL_GetPowerInfo(): on battery, pct=[0,100], was: %i",
  419. pct);
  420. }
  421. if (state==SDL_POWERSTATE_UNKNOWN ||
  422. state==SDL_POWERSTATE_NO_BATTERY)
  423. {
  424. SDLTest_AssertCheck(
  425. secs == -1,
  426. "SDL_GetPowerInfo(): no battery, secs == -1, was: %i",
  427. secs);
  428. SDLTest_AssertCheck(
  429. pct == -1,
  430. "SDL_GetPowerInfo(): no battery, pct == -1, was: %i",
  431. pct);
  432. }
  433. /* Partial return value variations */
  434. stateAgain = SDL_GetPowerInfo(&secsAgain, NULL);
  435. SDLTest_AssertCheck(
  436. state==stateAgain,
  437. "State %i returned when only 'secs' requested",
  438. stateAgain);
  439. SDLTest_AssertCheck(
  440. secs==secsAgain,
  441. "Value %i matches when only 'secs' requested",
  442. secsAgain);
  443. stateAgain = SDL_GetPowerInfo(NULL, &pctAgain);
  444. SDLTest_AssertCheck(
  445. state==stateAgain,
  446. "State %i returned when only 'pct' requested",
  447. stateAgain);
  448. SDLTest_AssertCheck(
  449. pct==pctAgain,
  450. "Value %i matches when only 'pct' requested",
  451. pctAgain);
  452. stateAgain = SDL_GetPowerInfo(NULL, NULL);
  453. SDLTest_AssertCheck(
  454. state==stateAgain,
  455. "State %i returned when no value requested",
  456. stateAgain);
  457. return TEST_COMPLETED;
  458. }
  459. /* ================= Test References ================== */
  460. /* Platform test cases */
  461. static const SDLTest_TestCaseReference platformTest1 =
  462. { (SDLTest_TestCaseFp)platform_testTypes, "platform_testTypes", "Tests predefined types", TEST_ENABLED};
  463. static const SDLTest_TestCaseReference platformTest2 =
  464. { (SDLTest_TestCaseFp)platform_testEndianessAndSwap, "platform_testEndianessAndSwap", "Tests endianness and swap functions", TEST_ENABLED};
  465. static const SDLTest_TestCaseReference platformTest3 =
  466. { (SDLTest_TestCaseFp)platform_testGetFunctions, "platform_testGetFunctions", "Tests various SDL_GetXYZ functions", TEST_ENABLED};
  467. static const SDLTest_TestCaseReference platformTest4 =
  468. { (SDLTest_TestCaseFp)platform_testHasFunctions, "platform_testHasFunctions", "Tests various SDL_HasXYZ functions", TEST_ENABLED};
  469. static const SDLTest_TestCaseReference platformTest5 =
  470. { (SDLTest_TestCaseFp)platform_testGetVersion, "platform_testGetVersion", "Tests SDL_GetVersion function", TEST_ENABLED};
  471. static const SDLTest_TestCaseReference platformTest6 =
  472. { (SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED};
  473. static const SDLTest_TestCaseReference platformTest7 =
  474. { (SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED};
  475. static const SDLTest_TestCaseReference platformTest8 =
  476. { (SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED};
  477. static const SDLTest_TestCaseReference platformTest9 =
  478. { (SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED};
  479. static const SDLTest_TestCaseReference platformTest10 =
  480. { (SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED};
  481. static const SDLTest_TestCaseReference platformTest11 =
  482. { (SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED };
  483. /* Sequence of Platform test cases */
  484. static const SDLTest_TestCaseReference *platformTests[] = {
  485. &platformTest1,
  486. &platformTest2,
  487. &platformTest3,
  488. &platformTest4,
  489. &platformTest5,
  490. &platformTest6,
  491. &platformTest7,
  492. &platformTest8,
  493. &platformTest9,
  494. &platformTest10,
  495. &platformTest11,
  496. NULL
  497. };
  498. /* Platform test suite (global) */
  499. SDLTest_TestSuiteReference platformTestSuite = {
  500. "Platform",
  501. NULL,
  502. platformTests,
  503. NULL
  504. };
  505. /* vi: set ts=4 sw=4 expandtab: */