test/testautomation_events.c
changeset 7191 75360622e65f
parent 6800 26c6795ec1a4
child 7677 871d43c6968a
     1.1 --- a/test/testautomation_events.c	Sat May 18 12:48:50 2013 -0700
     1.2 +++ b/test/testautomation_events.c	Sat May 18 14:17:52 2013 -0700
     1.3 @@ -28,14 +28,14 @@
     1.4  int _events_sampleNullEventFilter(void *userdata, SDL_Event *event)
     1.5  {
     1.6     _eventFilterCalled = 1;
     1.7 -   
     1.8 +
     1.9     if (_userdataCheck != 0) {
    1.10         SDLTest_AssertCheck(userdata != NULL, "Check userdata pointer, expected: non-NULL, got: %s", (userdata != NULL) ? "non-NULL" : "NULL");
    1.11         if (userdata != NULL) {
    1.12            SDLTest_AssertCheck(*(int *)userdata == _userdataValue, "Check userdata value, expected: %i, got: %i", _userdataValue, *(int *)userdata);
    1.13         }
    1.14     }
    1.15 -   
    1.16 +
    1.17     return 0;
    1.18  }
    1.19  
    1.20 @@ -51,24 +51,24 @@
    1.21     SDL_Event event1;
    1.22     SDL_Event event2;
    1.23     int result;
    1.24 -   
    1.25 +
    1.26     /* Create user event */
    1.27     event1.type = SDL_USEREVENT;
    1.28     event1.user.code = SDLTest_RandomSint32();
    1.29     event1.user.data1 = (void *)&_userdataValue1;
    1.30     event1.user.data2 = (void *)&_userdataValue2;
    1.31 -   
    1.32 +
    1.33     /* Push a user event onto the queue and force queue update*/
    1.34     SDL_PushEvent(&event1);
    1.35     SDLTest_AssertPass("Call to SDL_PushEvent()");
    1.36     SDL_PumpEvents();
    1.37     SDLTest_AssertPass("Call to SDL_PumpEvents()");
    1.38 -   
    1.39 +
    1.40     /* Poll for user event */
    1.41     result = SDL_PollEvent(&event2);
    1.42     SDLTest_AssertPass("Call to SDL_PollEvent()");
    1.43     SDLTest_AssertCheck(result == 1, "Check result from SDL_PollEvent, expected: 1, got: %d", result);
    1.44 -   
    1.45 +
    1.46     return TEST_COMPLETED;
    1.47  }
    1.48  
    1.49 @@ -84,7 +84,7 @@
    1.50  events_addDelEventWatch(void *arg)
    1.51  {
    1.52     SDL_Event event;
    1.53 -   
    1.54 +
    1.55     /* Create user event */
    1.56     event.type = SDL_USEREVENT;
    1.57     event.user.code = SDLTest_RandomSint32();;
    1.58 @@ -97,10 +97,10 @@
    1.59     /* Reset event filter call tracker */
    1.60     _eventFilterCalled = 0;
    1.61  
    1.62 -   /* Add watch */      
    1.63 +   /* Add watch */
    1.64     SDL_AddEventWatch(_events_sampleNullEventFilter, NULL);
    1.65     SDLTest_AssertPass("Call to SDL_AddEventWatch()");
    1.66 -   
    1.67 +
    1.68     /* Push a user event onto the queue and force queue update*/
    1.69     SDL_PushEvent(&event);
    1.70     SDLTest_AssertPass("Call to SDL_PushEvent()");
    1.71 @@ -134,13 +134,13 @@
    1.72  events_addDelEventWatchWithUserdata(void *arg)
    1.73  {
    1.74     SDL_Event event;
    1.75 -   
    1.76 +
    1.77     /* Create user event */
    1.78     event.type = SDL_USEREVENT;
    1.79     event.user.code = SDLTest_RandomSint32();;
    1.80     event.user.data1 = (void *)&_userdataValue1;
    1.81     event.user.data2 = (void *)&_userdataValue2;
    1.82 -   
    1.83 +
    1.84     /* Enable userdata check and set a value to check */
    1.85     _userdataCheck = 1;
    1.86     _userdataValue = SDLTest_RandomIntegerInRange(-1024, 1024);
    1.87 @@ -148,7 +148,7 @@
    1.88     /* Reset event filter call tracker */
    1.89     _eventFilterCalled = 0;
    1.90  
    1.91 -   /* Add watch */    
    1.92 +   /* Add watch */
    1.93     SDL_AddEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue);
    1.94     SDLTest_AssertPass("Call to SDL_AddEventWatch()");
    1.95  
    1.96 @@ -162,7 +162,7 @@
    1.97     /* Delete watch */
    1.98     SDL_DelEventWatch(_events_sampleNullEventFilter, (void *)&_userdataValue);
    1.99     SDLTest_AssertPass("Call to SDL_DelEventWatch()");
   1.100 -     
   1.101 +
   1.102     /* Push a user event onto the queue and force queue update*/
   1.103     _eventFilterCalled = 0;
   1.104     SDL_PushEvent(&event);
   1.105 @@ -170,7 +170,7 @@
   1.106     SDL_PumpEvents();
   1.107     SDLTest_AssertPass("Call to SDL_PumpEvents()");
   1.108     SDLTest_AssertCheck(_eventFilterCalled == 0, "Check that event filter was NOT called");
   1.109 -   
   1.110 +
   1.111     return TEST_COMPLETED;
   1.112  }
   1.113  
   1.114 @@ -179,23 +179,23 @@
   1.115  
   1.116  /* Events test cases */
   1.117  static const SDLTest_TestCaseReference eventsTest1 =
   1.118 -		{ (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED };
   1.119 +        { (SDLTest_TestCaseFp)events_pushPumpAndPollUserevent, "events_pushPumpAndPollUserevent", "Pushes, pumps and polls a user event", TEST_ENABLED };
   1.120  
   1.121  static const SDLTest_TestCaseReference eventsTest2 =
   1.122 -		{ (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED };
   1.123 +        { (SDLTest_TestCaseFp)events_addDelEventWatch, "events_addDelEventWatch", "Adds and deletes an event watch function with NULL userdata", TEST_ENABLED };
   1.124  
   1.125  static const SDLTest_TestCaseReference eventsTest3 =
   1.126 -		{ (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED };
   1.127 +        { (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED };
   1.128  
   1.129  /* Sequence of Events test cases */
   1.130  static const SDLTest_TestCaseReference *eventsTests[] =  {
   1.131 -	&eventsTest1, &eventsTest2, &eventsTest3, NULL
   1.132 +    &eventsTest1, &eventsTest2, &eventsTest3, NULL
   1.133  };
   1.134  
   1.135  /* Events test suite (global) */
   1.136  SDLTest_TestSuiteReference eventsTestSuite = {
   1.137 -	"Events",
   1.138 -	NULL,
   1.139 -	eventsTests,
   1.140 -	NULL
   1.141 +    "Events",
   1.142 +    NULL,
   1.143 +    eventsTests,
   1.144 +    NULL
   1.145  };