test/testautomation_syswm.c
changeset 7191 75360622e65f
parent 6800 26c6795ec1a4
child 9219 c65108ddbeb0
equal deleted inserted replaced
7190:11612d544fcd 7191:75360622e65f
    15  */
    15  */
    16 int
    16 int
    17 syswm_getWindowWMInfo(void *arg)
    17 syswm_getWindowWMInfo(void *arg)
    18 {
    18 {
    19   SDL_bool result;
    19   SDL_bool result;
    20   SDL_Window *window; 
    20   SDL_Window *window;
    21   SDL_SysWMinfo info;
    21   SDL_SysWMinfo info;
    22   
    22 
    23   window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
    23   window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
    24   SDLTest_AssertPass("Call to SDL_CreateWindow()");
    24   SDLTest_AssertPass("Call to SDL_CreateWindow()");
    25   SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
    25   SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
    26   if (window == NULL) {
    26   if (window == NULL) {
    27      return TEST_ABORTED;
    27      return TEST_ABORTED;
    28   }
    28   }
    29   
    29 
    30   /* Initialize info structure with SDL version info */
    30   /* Initialize info structure with SDL version info */
    31   SDL_VERSION(&info.version); 
    31   SDL_VERSION(&info.version);
    32   
    32 
    33   /* Make call */
    33   /* Make call */
    34   result = SDL_GetWindowWMInfo(window, &info);
    34   result = SDL_GetWindowWMInfo(window, &info);
    35   SDLTest_AssertPass("Call to SDL_GetWindowWMInfo");
    35   SDLTest_AssertPass("Call to SDL_GetWindowWMInfo");
    36   SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
    36   SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
    37                                                                                                       		
    37 
    38   SDL_DestroyWindow(window);
    38   SDL_DestroyWindow(window);
    39   SDLTest_AssertPass("Call to SDL_DestroyWindow()");
    39   SDLTest_AssertPass("Call to SDL_DestroyWindow()");
    40   
    40 
    41   return TEST_COMPLETED;
    41   return TEST_COMPLETED;
    42 }
    42 }
    43 
    43 
    44 /* ================= Test References ================== */
    44 /* ================= Test References ================== */
    45 
    45 
    46 /* SysWM test cases */
    46 /* SysWM test cases */
    47 static const SDLTest_TestCaseReference syswmTest1 =
    47 static const SDLTest_TestCaseReference syswmTest1 =
    48 		{ (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED };
    48         { (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED };
    49 
    49 
    50 /* Sequence of SysWM test cases */
    50 /* Sequence of SysWM test cases */
    51 static const SDLTest_TestCaseReference *syswmTests[] =  {
    51 static const SDLTest_TestCaseReference *syswmTests[] =  {
    52 	&syswmTest1, NULL
    52     &syswmTest1, NULL
    53 };
    53 };
    54 
    54 
    55 /* SysWM test suite (global) */
    55 /* SysWM test suite (global) */
    56 SDLTest_TestSuiteReference syswmTestSuite = {
    56 SDLTest_TestSuiteReference syswmTestSuite = {
    57 	"SysWM",
    57     "SysWM",
    58 	NULL,
    58     NULL,
    59 	syswmTests,
    59     syswmTests,
    60 	NULL
    60     NULL
    61 };
    61 };