Add new test suites (events, keyboard, syswm, video) with a few new tests each
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Sun, 06 Jan 2013 15:17:59 -0800
changeset 680026c6795ec1a4
parent 6799 ddf4df4dfdd6
child 6801 f92e3d5f71a2
Add new test suites (events, keyboard, syswm, video) with a few new tests each
VisualC/tests/testautomation/testautomation_vs2010.vcxproj
VisualC/tests/testautomation/testautomation_vs2012.vcxproj
test/Makefile.in
test/testautomation_events.c
test/testautomation_keyboard.c
test/testautomation_suites.h
test/testautomation_syswm.c
test/testautomation_video.c
     1.1 --- a/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Mon Dec 31 19:22:05 2012 -0800
     1.2 +++ b/VisualC/tests/testautomation/testautomation_vs2010.vcxproj	Sun Jan 06 15:17:59 2013 -0800
     1.3 @@ -184,6 +184,10 @@
     1.4      <ClCompile Include="..\..\..\test\testautomation_render.c" />
     1.5      <ClCompile Include="..\..\..\test\testautomation_rwops.c" />
     1.6      <ClCompile Include="..\..\..\test\testautomation_surface.c" />
     1.7 +    <ClCompile Include="..\..\..\test\testautomation_events.c" />
     1.8 +    <ClCompile Include="..\..\..\test\testautomation_keyboard.c" />
     1.9 +    <ClCompile Include="..\..\..\test\testautomation_video.c" />
    1.10 +    <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
    1.11    </ItemGroup>
    1.12    <ItemGroup>
    1.13      <ClInclude Include="..\..\..\test\testautomation_suites.h" />
     2.1 --- a/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Mon Dec 31 19:22:05 2012 -0800
     2.2 +++ b/VisualC/tests/testautomation/testautomation_vs2012.vcxproj	Sun Jan 06 15:17:59 2013 -0800
     2.3 @@ -188,6 +188,10 @@
     2.4      <ClCompile Include="..\..\..\test\testautomation_render.c" />
     2.5      <ClCompile Include="..\..\..\test\testautomation_rwops.c" />
     2.6      <ClCompile Include="..\..\..\test\testautomation_surface.c" />
     2.7 +    <ClCompile Include="..\..\..\test\testautomation_events.c" />
     2.8 +    <ClCompile Include="..\..\..\test\testautomation_keyboard.c" />
     2.9 +    <ClCompile Include="..\..\..\test\testautomation_video.c" />
    2.10 +    <ClCompile Include="..\..\..\test\testautomation_syswm.c" />
    2.11    </ItemGroup>
    2.12    <ItemGroup>
    2.13      <ClInclude Include="..\..\..\test\testautomation_suites.h" />
     3.1 --- a/test/Makefile.in	Mon Dec 31 19:22:05 2012 -0800
     3.2 +++ b/test/Makefile.in	Sun Jan 06 15:17:59 2013 -0800
     3.3 @@ -75,7 +75,11 @@
     3.4  		      $(srcdir)/testautomation_render.c \
     3.5  		      $(srcdir)/testautomation_rwops.c \
     3.6  		      $(srcdir)/testautomation_audio.c \
     3.7 -		      $(srcdir)/testautomation_surface.c
     3.8 +		      $(srcdir)/testautomation_surface.c \
     3.9 +		      $(srcdir)/testautomation_events.c \
    3.10 +		      $(srcdir)/testautomation_keyboard.c \
    3.11 +		      $(srcdir)/testautomation_video.c \
    3.12 +		      $(srcdir)/testautomation_syswm.c
    3.13  	$(CC) -o $@ $^ $(CFLAGS) -lSDL2_test $(LIBS) 
    3.14  
    3.15  testmultiaudio$(EXE): $(srcdir)/testmultiaudio.c
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/test/testautomation_events.c	Sun Jan 06 15:17:59 2013 -0800
     4.3 @@ -0,0 +1,201 @@
     4.4 +/**
     4.5 + * Events test suite
     4.6 + */
     4.7 +
     4.8 +#include <stdio.h>
     4.9 +
    4.10 +#include "SDL.h"
    4.11 +#include "SDL_test.h"
    4.12 +
    4.13 +/* ================= Test Case Implementation ================== */
    4.14 +
    4.15 +/* Test case functions */
    4.16 +
    4.17 +/* Flag indicating if the userdata should be checked */
    4.18 +int _userdataCheck = 0;
    4.19 +
    4.20 +/* Userdata value to check */
    4.21 +int _userdataValue = 0;
    4.22 +
    4.23 +/* Flag indicating that the filter was called */
    4.24 +int _eventFilterCalled = 0;
    4.25 +
    4.26 +/* Userdata values for event */
    4.27 +int _userdataValue1 = 1;
    4.28 +int _userdataValue2 = 2;
    4.29 +
    4.30 +/* Event filter that sets some flags and optionally checks userdata */
    4.31 +int _events_sampleNullEventFilter(void *userdata, SDL_Event *event)
    4.32 +{
    4.33 +   _eventFilterCalled = 1;
    4.34 +   
    4.35 +   if (_userdataCheck != 0) {
    4.36 +       SDLTest_AssertCheck(userdata != NULL, "Check userdata pointer, expected: non-NULL, got: %s", (userdata != NULL) ? "non-NULL" : "NULL");
    4.37 +       if (userdata != NULL) {
    4.38 +          SDLTest_AssertCheck(*(int *)userdata == _userdataValue, "Check userdata value, expected: %i, got: %i", _userdataValue, *(int *)userdata);
    4.39 +       }
    4.40 +   }
    4.41 +   
    4.42 +   return 0;
    4.43 +}
    4.44 +
    4.45 +/**
    4.46 + * @brief Test pumping and peeking events.
    4.47 + *
    4.48 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_PumpEvents
    4.49 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_PollEvent
    4.50 + */
    4.51 +int
    4.52 +events_pushPumpAndPollUserevent(void *arg)
    4.53 +{
    4.54 +   SDL_Event event1;
    4.55 +   SDL_Event event2;
    4.56 +   int result;
    4.57 +   
    4.58 +   /* Create user event */
    4.59 +   event1.type = SDL_USEREVENT;
    4.60 +   event1.user.code = SDLTest_RandomSint32();
    4.61 +   event1.user.data1 = (void *)&_userdataValue1;
    4.62 +   event1.user.data2 = (void *)&_userdataValue2;
    4.63 +   
    4.64 +   /* Push a user event onto the queue and force queue update*/
    4.65 +   SDL_PushEvent(&event1);
    4.66 +   SDLTest_AssertPass("Call to SDL_PushEvent()");
    4.67 +   SDL_PumpEvents();
    4.68 +   SDLTest_AssertPass("Call to SDL_PumpEvents()");
    4.69 +   
    4.70 +   /* Poll for user event */
    4.71 +   result = SDL_PollEvent(&event2);
    4.72 +   SDLTest_AssertPass("Call to SDL_PollEvent()");
    4.73 +   SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result);
    4.74 +   
    4.75 +   return TEST_COMPLETED;
    4.76 +}
    4.77 +
    4.78 +
    4.79 +/**
    4.80 + * @brief Adds and deletes an event watch function with NULL userdata
    4.81 + *
    4.82 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_AddEventWatch
    4.83 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_DelEventWatch
    4.84 + *
    4.85 + */
    4.86 +int
    4.87 +events_addDelEventWatch(void *arg)
    4.88 +{
    4.89 +   SDL_Event event;
    4.90 +   
    4.91 +   /* Create user event */
    4.92 +   event.type = SDL_USEREVENT;
    4.93 +   event.user.code = SDLTest_RandomSint32();;
    4.94 +   event.user.data1 = (void *)&_userdataValue1;
    4.95 +   event.user.data2 = (void *)&_userdataValue2;
    4.96 +
    4.97 +   /* Disable userdata check */
    4.98 +   _userdataCheck = 0;
    4.99 +
   4.100 +   /* Reset event filter call tracker */
   4.101 +   _eventFilterCalled = 0;
   4.102 +
   4.103 +   /* Add watch */      
   4.104 +   SDL_AddEventWatch(_events_sampleNullEventFilter, NULL);
   4.105 +   SDLTest_AssertPass("Call to SDL_AddEventWatch()");
   4.106 +   
   4.107 +   /* Push a user event onto the queue and force queue update*/
   4.108 +   SDL_PushEvent(&event);
   4.109 +   SDLTest_AssertPass("Call to SDL_PushEvent()");
   4.110 +   SDL_PumpEvents();
   4.111 +   SDLTest_AssertPass("Call to SDL_PumpEvents()");
   4.112 +   SDLTest_AssertCheck(_eventFilterCalled == 1, "Check that event filter was called");
   4.113 +
   4.114 +   /* Delete watch */
   4.115 +   SDL_DelEventWatch(_events_sampleNullEventFilter, NULL);
   4.116 +   SDLTest_AssertPass("Call to SDL_DelEventWatch()");
   4.117 +
   4.118 +   /* Push a user event onto the queue and force queue update*/
   4.119 +   _eventFilterCalled = 0;
   4.120 +   SDL_PushEvent(&event);
   4.121 +   SDLTest_AssertPass("Call to SDL_PushEvent()");
   4.122 +   SDL_PumpEvents();
   4.123 +   SDLTest_AssertPass("Call to SDL_PumpEvents()");
   4.124 +   SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called");
   4.125 +
   4.126 +   return TEST_COMPLETED;
   4.127 +}
   4.128 +
   4.129 +/**
   4.130 + * @brief Adds and deletes an event watch function with userdata
   4.131 + *
   4.132 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_AddEventWatch
   4.133 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_DelEventWatch
   4.134 + *
   4.135 + */
   4.136 +int
   4.137 +events_addDelEventWatchWithUserdata(void *arg)
   4.138 +{
   4.139 +   SDL_Event event;
   4.140 +   
   4.141 +   /* Create user event */
   4.142 +   event.type = SDL_USEREVENT;
   4.143 +   event.user.code = SDLTest_RandomSint32();;
   4.144 +   event.user.data1 = (void *)&_userdataValue1;
   4.145 +   event.user.data2 = (void *)&_userdataValue2;
   4.146 +   
   4.147 +   /* Enable userdata check and set a value to check */
   4.148 +   _userdataCheck = 1;
   4.149 +   _userdataValue = SDLTest_RandomIntegerInRange(-1024, 1024);
   4.150 +
   4.151 +   /* Reset event filter call tracker */
   4.152 +   _eventFilterCalled = 0;
   4.153 +
   4.154 +   /* Add watch */    
   4.155 +   SDL_AddEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue);
   4.156 +   SDLTest_AssertPass("Call to SDL_AddEventWatch()");
   4.157 +
   4.158 +   /* Push a user event onto the queue and force queue update*/
   4.159 +   SDL_PushEvent(&event);
   4.160 +   SDLTest_AssertPass("Call to SDL_PushEvent()");
   4.161 +   SDL_PumpEvents();
   4.162 +   SDLTest_AssertPass("Call to SDL_PumpEvents()");
   4.163 +   SDLTest_AssertCheck(_eventFilterCalled == 1, "Check that event filter was called");
   4.164 +
   4.165 +   /* Delete watch */
   4.166 +   SDL_DelEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue);
   4.167 +   SDLTest_AssertPass("Call to SDL_DelEventWatch()");
   4.168 +     
   4.169 +   /* Push a user event onto the queue and force queue update*/
   4.170 +   _eventFilterCalled = 0;
   4.171 +   SDL_PushEvent(&event);
   4.172 +   SDLTest_AssertPass("Call to SDL_PushEvent()");
   4.173 +   SDL_PumpEvents();
   4.174 +   SDLTest_AssertPass("Call to SDL_PumpEvents()");
   4.175 +   SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called");
   4.176 +   
   4.177 +   return TEST_COMPLETED;
   4.178 +}
   4.179 +
   4.180 +
   4.181 +/* ================= Test References ================== */
   4.182 +
   4.183 +/* Events test cases */
   4.184 +static const SDLTest_TestCaseReference eventsTest1 =
   4.185 +		{ (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED };
   4.186 +
   4.187 +static const SDLTest_TestCaseReference eventsTest2 =
   4.188 +		{ (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED };
   4.189 +
   4.190 +static const SDLTest_TestCaseReference eventsTest3 =
   4.191 +		{ (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED };
   4.192 +
   4.193 +/* Sequence of Events test cases */
   4.194 +static const SDLTest_TestCaseReference *eventsTests[] =  {
   4.195 +	&eventsTest1, &eventsTest2, &eventsTest3, NULL
   4.196 +};
   4.197 +
   4.198 +/* Events test suite (global) */
   4.199 +SDLTest_TestSuiteReference eventsTestSuite = {
   4.200 +	"Events",
   4.201 +	NULL,
   4.202 +	eventsTests,
   4.203 +	NULL
   4.204 +};
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/test/testautomation_keyboard.c	Sun Jan 06 15:17:59 2013 -0800
     5.3 @@ -0,0 +1,61 @@
     5.4 +/**
     5.5 + * Keyboard test suite
     5.6 + */
     5.7 +
     5.8 +#include <stdio.h>
     5.9 +
    5.10 +#include "SDL.h"
    5.11 +#include "SDL_test.h"
    5.12 +
    5.13 +/* ================= Test Case Implementation ================== */
    5.14 +
    5.15 +/*!
    5.16 + * TODO: Add tests for keyboard here
    5.17 + *
    5.18 + */
    5.19 +
    5.20 +/* Test case functions */
    5.21 +
    5.22 +/**
    5.23 + * @brief Check call to SDL_GetKeyboardState
    5.24 + * 
    5.25 + */
    5.26 +int
    5.27 +keyboard_getKeyboardState(void *arg)
    5.28 +{
    5.29 +   int numkeys;
    5.30 +   Uint8 *state;
    5.31 +
    5.32 +   /* Case where numkeys pointer is NULL */    
    5.33 +   state = SDL_GetKeyboardState(NULL);
    5.34 +   SDLTest_AssertPass("Call to SDL_GetKeyboardState(NULL)");
    5.35 +   SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL");
    5.36 +
    5.37 +   /* Case where numkeys pointer is not NULL */
    5.38 +   numkeys = -1;
    5.39 +   state = SDL_GetKeyboardState(&numkeys);
    5.40 +   SDLTest_AssertPass("Call to SDL_GetKeyboardState(&numkeys)");
    5.41 +   SDLTest_AssertCheck(state != NULL, "Validate that return value from SDL_GetKeyboardState is not NULL");
    5.42 +   SDLTest_AssertCheck(numkeys >= 0, "Validate that value of numkeys is >= 0, got: %i", numkeys);
    5.43 +   
    5.44 +   return TEST_COMPLETED;
    5.45 +}
    5.46 +
    5.47 +/* ================= Test References ================== */
    5.48 +
    5.49 +/* Keyboard test cases */
    5.50 +static const SDLTest_TestCaseReference keyboardTest1 =
    5.51 +		{ (SDLTest_TestCaseFp)keyboard_getKeyboardState, "keyboard_getKeyboardState", "Check call to SDL_GetKeyboardState", TEST_ENABLED };
    5.52 +
    5.53 +/* Sequence of Keyboard test cases */
    5.54 +static const SDLTest_TestCaseReference *keyboardTests[] =  {
    5.55 +	&keyboardTest1, NULL
    5.56 +};
    5.57 +
    5.58 +/* Keyboard test suite (global) */
    5.59 +SDLTest_TestSuiteReference keyboardTestSuite = {
    5.60 +	"Keyboard",
    5.61 +	NULL,
    5.62 +	keyboardTests,
    5.63 +	NULL
    5.64 +};
     6.1 --- a/test/testautomation_suites.h	Mon Dec 31 19:22:05 2012 -0800
     6.2 +++ b/test/testautomation_suites.h	Sun Jan 06 15:17:59 2013 -0800
     6.3 @@ -11,29 +11,29 @@
     6.4  // Test collections
     6.5  extern SDLTest_TestSuiteReference audioTestSuite;
     6.6  extern SDLTest_TestSuiteReference clipboardTestSuite;
     6.7 -//extern SDLTest_TestSuiteReference eventsTestSuite;
     6.8 -//extern SDLTest_TestSuiteReference keyboardTestSuite;
     6.9 +extern SDLTest_TestSuiteReference eventsTestSuite;
    6.10 +extern SDLTest_TestSuiteReference keyboardTestSuite;
    6.11  extern SDLTest_TestSuiteReference platformTestSuite;
    6.12  extern SDLTest_TestSuiteReference rectTestSuite;
    6.13  extern SDLTest_TestSuiteReference renderTestSuite;
    6.14  extern SDLTest_TestSuiteReference rwopsTestSuite;
    6.15  extern SDLTest_TestSuiteReference surfaceTestSuite;
    6.16 -//extern SDLTest_TestSuiteReference syswmTestSuite;
    6.17 -//extern SDLTest_TestSuiteReference videoTestSuite;
    6.18 +extern SDLTest_TestSuiteReference syswmTestSuite;
    6.19 +extern SDLTest_TestSuiteReference videoTestSuite;
    6.20  
    6.21  // All test suites
    6.22  SDLTest_TestSuiteReference *testSuites[] =  {
    6.23  	&audioTestSuite,
    6.24  	&clipboardTestSuite,
    6.25 -//	&eventsTestSuite,
    6.26 -//	&keyboardTestSuite,
    6.27 +	&eventsTestSuite,
    6.28 +	&keyboardTestSuite,
    6.29  	&platformTestSuite,
    6.30  	&rectTestSuite,
    6.31  	&renderTestSuite,
    6.32  	&rwopsTestSuite,
    6.33  	&surfaceTestSuite,
    6.34 -//	&syswmTestSuite,
    6.35 -//	&videoTestSuite,
    6.36 +	&syswmTestSuite,
    6.37 +	&videoTestSuite,
    6.38  	NULL
    6.39  };
    6.40  
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/test/testautomation_syswm.c	Sun Jan 06 15:17:59 2013 -0800
     7.3 @@ -0,0 +1,61 @@
     7.4 +/**
     7.5 + * SysWM test suite
     7.6 + */
     7.7 +
     7.8 +#include <stdio.h>
     7.9 +
    7.10 +#include "SDL.h"
    7.11 +#include "SDL_syswm.h"
    7.12 +#include "SDL_test.h"
    7.13 +
    7.14 +/* Test case functions */
    7.15 +
    7.16 +/**
    7.17 + * @brief Call to SDL_GetWindowWMInfo
    7.18 + */
    7.19 +int
    7.20 +syswm_getWindowWMInfo(void *arg)
    7.21 +{
    7.22 +  SDL_bool result;
    7.23 +  SDL_Window *window; 
    7.24 +  SDL_SysWMinfo info;
    7.25 +  
    7.26 +  window = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN);
    7.27 +  SDLTest_AssertPass("Call to SDL_CreateWindow()");
    7.28 +  SDLTest_AssertCheck(window != NULL, "Check that value returned from SDL_CreateWindow is not NULL");
    7.29 +  if (window == NULL) {
    7.30 +     return TEST_ABORTED;
    7.31 +  }
    7.32 +  
    7.33 +  /* Initialize info structure with SDL version info */
    7.34 +  SDL_VERSION(&info.version); 
    7.35 +  
    7.36 +  /* Make call */
    7.37 +  result = SDL_GetWindowWMInfo(window, &info);
    7.38 +  SDLTest_AssertPass("Call to SDL_GetWindowWMInfo");
    7.39 +  SDLTest_Log((result == SDL_TRUE) ? "Got window information" : "Couldn't get window information");
    7.40 +                                                                                                      		
    7.41 +  SDL_DestroyWindow(window);
    7.42 +  SDLTest_AssertPass("Call to SDL_DestroyWindow()");
    7.43 +  
    7.44 +  return TEST_COMPLETED;
    7.45 +}
    7.46 +
    7.47 +/* ================= Test References ================== */
    7.48 +
    7.49 +/* SysWM test cases */
    7.50 +static const SDLTest_TestCaseReference syswmTest1 =
    7.51 +		{ (SDLTest_TestCaseFp)syswm_getWindowWMInfo, "syswm_getWindowWMInfo", "Call to SDL_GetWindowWMInfo", TEST_ENABLED };
    7.52 +
    7.53 +/* Sequence of SysWM test cases */
    7.54 +static const SDLTest_TestCaseReference *syswmTests[] =  {
    7.55 +	&syswmTest1, NULL
    7.56 +};
    7.57 +
    7.58 +/* SysWM test suite (global) */
    7.59 +SDLTest_TestSuiteReference syswmTestSuite = {
    7.60 +	"SysWM",
    7.61 +	NULL,
    7.62 +	syswmTests,
    7.63 +	NULL
    7.64 +};
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/test/testautomation_video.c	Sun Jan 06 15:17:59 2013 -0800
     8.3 @@ -0,0 +1,81 @@
     8.4 +/**
     8.5 + * Video test suite
     8.6 + */
     8.7 +
     8.8 +#include <stdio.h>
     8.9 +
    8.10 +#include "SDL.h"
    8.11 +#include "SDL_test.h"
    8.12 +
    8.13 +/* Test case functions */
    8.14 +
    8.15 +/**
    8.16 + * @brief Enable and disable screensaver while checking state
    8.17 + */
    8.18 +int
    8.19 +video_enableDisableScreensaver(void *arg)
    8.20 +{
    8.21 +	SDL_bool initialResult;
    8.22 +	SDL_bool result;
    8.23 +
    8.24 +	/* Get current state and proceed according to current state */
    8.25 +	initialResult = SDL_IsScreenSaverEnabled();
    8.26 +	SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()");	
    8.27 +	if (initialResult == SDL_TRUE) {
    8.28 +	
    8.29 +	  /* Currently enabled: disable first, then enable again */
    8.30 +	  
    8.31 +	  /* Disable screensaver and check */	
    8.32 +	  SDL_DisableScreenSaver();
    8.33 +	  SDLTest_AssertPass("Call to SDL_DisableScreenSaver()");	
    8.34 +	  result = SDL_IsScreenSaverEnabled();
    8.35 +	  SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()");
    8.36 +	  SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result);
    8.37 +	
    8.38 +	  /* Enable screensaver and check */	
    8.39 +	  SDL_EnableScreenSaver();
    8.40 +	  SDLTest_AssertPass("Call to SDL_EnableScreenSaver()");
    8.41 +	  result = SDL_IsScreenSaverEnabled();
    8.42 +	  SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()");
    8.43 +	  SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result);
    8.44 +
    8.45 +	} else {
    8.46 +
    8.47 +	  /* Currently disabled: enable first, then disable again */
    8.48 +	  
    8.49 +	  /* Enable screensaver and check */	
    8.50 +	  SDL_EnableScreenSaver();
    8.51 +	  SDLTest_AssertPass("Call to SDL_EnableScreenSaver()");
    8.52 +	  result = SDL_IsScreenSaverEnabled();
    8.53 +	  SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()");
    8.54 +	  SDLTest_AssertCheck(result == SDL_TRUE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_TRUE, result);
    8.55 +
    8.56 +	  /* Disable screensaver and check */	
    8.57 +	  SDL_DisableScreenSaver();
    8.58 +	  SDLTest_AssertPass("Call to SDL_DisableScreenSaver()");	
    8.59 +	  result = SDL_IsScreenSaverEnabled();
    8.60 +	  SDLTest_AssertPass("Call to SDL_IsScreenSaverEnabled()");
    8.61 +	  SDLTest_AssertCheck(result == SDL_FALSE, "Verify result from SDL_IsScreenSaverEnabled, expected: %i, got: %i", SDL_FALSE, result);	
    8.62 +	}	
    8.63 +	
    8.64 +	return TEST_COMPLETED;
    8.65 +}
    8.66 +
    8.67 +/* ================= Test References ================== */
    8.68 +
    8.69 +/* Video test cases */
    8.70 +static const SDLTest_TestCaseReference videoTest1 =
    8.71 +		{ (SDLTest_TestCaseFp)video_enableDisableScreensaver, "video_enableDisableScreensaver",  "Enable and disable screenaver while checking state", TEST_ENABLED };
    8.72 +
    8.73 +/* Sequence of Video test cases */
    8.74 +static const SDLTest_TestCaseReference *videoTests[] =  {
    8.75 +	&videoTest1, NULL
    8.76 +};
    8.77 +
    8.78 +/* Video test suite (global) */
    8.79 +SDLTest_TestSuiteReference videoTestSuite = {
    8.80 +	"Video",
    8.81 +	NULL,
    8.82 +	videoTests,
    8.83 +	NULL
    8.84 +};