🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

  1. /**
  2. * SysWM test suite
  3. */
  4. #include <stdio.h>
  5. #include "SDL.h"
  6. #include "SDL_syswm.h"
  7. #include "SDL_test.h"
  8. /* Test case functions */
  9. /**
  10. * @brief Call to SDL_GetWindowWMInfo
  11. */
  12. int syswm_getWindowWMInfo(void *arg)
  13. {
  14. SDL_bool result;
  15. SDL_Window *window;
  16. SDL_SysWMinfo info;
  17. window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
  18. SDLTest_AssertPass("Call to SDL_CreateWindow()");
  19. SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
  20. if (window == NULL) {
  21. return TEST_ABORTED;
  22. }
  23. /* Initialize info structure with SDL version info */
  24. SDL_VERSION(&info.version);
  25. /* Make call */
  26. result = SDL_GetWindowWMInfo(window, &info);
  27. SDLTest_AssertPass("Call to SDL_GetWindowWMInfo()");
  28. SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
  29. SDL_DestroyWindow(window);
  30. SDLTest_AssertPass("Call to SDL_DestroyWindow()");
  31. return TEST_COMPLETED;
  32. }
  33. /* ================= Test References ================== */
  34. /* SysWM test cases */
  35. static const SDLTest_TestCaseReference syswmTest1 = {
  36. (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED
  37. };
  38. /* Sequence of SysWM test cases */
  39. static const SDLTest_TestCaseReference *syswmTests[] = {
  40. &syswmTest1, NULL
  41. };
  42. /* SysWM test suite (global) */
  43. SDLTest_TestSuiteReference syswmTestSuite = {
  44. "SysWM",
  45. NULL,
  46. syswmTests,
  47. NULL
  48. };