Add mouse tests; update test suites
authorAndreas Schiffler <aschiffler@ferzkopp.net>
Thu, 24 Jan 2013 07:58:59 -0800
changeset 682218f6818ba281
parent 6821 f36771112651
child 6823 e9d312d26979
Add mouse tests; update test suites
test/testautomation_audio.c
test/testautomation_clipboard.c
test/testautomation_mouse.c
test/testautomation_render.c
test/testautomation_surface.c
     1.1 --- a/test/testautomation_audio.c	Wed Jan 23 08:03:19 2013 -0800
     1.2 +++ b/test/testautomation_audio.c	Thu Jan 24 07:58:59 2013 -0800
     1.3 @@ -3,9 +3,6 @@
     1.4   * New/updated tests: aschiffler at ferzkopp dot net
     1.5   */
     1.6  
     1.7 -/* quiet windows compiler warnings */
     1.8 -#define _CRT_SECURE_NO_WARNINGS
     1.9 -
    1.10  #include <stdio.h>
    1.11  #include <string.h>
    1.12  
    1.13 @@ -311,29 +308,29 @@
    1.14      SDLTest_AssertPass("Call to SDL_ClearError()");
    1.15     
    1.16      /* Set various invalid format inputs */
    1.17 -    strcpy(message, "Invalid: ");
    1.18 +    SDL_strlcpy(message, "Invalid: ", 256);
    1.19      if (i & 1) {
    1.20 -        strcat(message, " spec1.format");
    1.21 +        SDL_strlcat(message, " spec1.format", 256);
    1.22          spec1.format = 0;
    1.23      }
    1.24      if (i & 2) { 
    1.25 -        strcat(message, " spec1.channels");
    1.26 +        SDL_strlcat(message, " spec1.channels", 256);
    1.27          spec1.channels = 0;
    1.28      }
    1.29      if (i & 4) { 
    1.30 -        strcat(message, " spec1.freq");
    1.31 +        SDL_strlcat(message, " spec1.freq", 256);
    1.32          spec1.freq = 0;
    1.33      }
    1.34      if (i & 8) { 
    1.35 -        strcat(message, " spec2.format");
    1.36 +        SDL_strlcat(message, " spec2.format", 256);
    1.37          spec2.format = 0;
    1.38      }
    1.39      if (i & 16) { 
    1.40 -        strcat(message, " spec2.channels");
    1.41 +        SDL_strlcat(message, " spec2.channels", 256);
    1.42          spec2.channels = 0;
    1.43      }
    1.44      if (i & 32) { 
    1.45 -        strcat(message, " spec2.freq");
    1.46 +        SDL_strlcat(message, " spec2.freq", 256);
    1.47          spec2.freq = 0;
    1.48      }
    1.49      SDLTest_Log(message);
     2.1 --- a/test/testautomation_clipboard.c	Wed Jan 23 08:03:19 2013 -0800
     2.2 +++ b/test/testautomation_clipboard.c	Thu Jan 24 07:58:59 2013 -0800
     2.3 @@ -118,9 +118,9 @@
     2.4  		charResult != NULL,
     2.5  		"Verify SDL_GetClipboardText did not return NULL");
     2.6  	SDLTest_AssertCheck(
     2.7 -		strlen(charResult) == 0,
     2.8 +		SDL_strlen(charResult) == 0,
     2.9  		"Verify SDL_GetClipboardText returned string with length 0, got length %i",
    2.10 -		strlen(charResult));
    2.11 +		SDL_strlen(charResult));
    2.12      intResult = SDL_SetClipboardText((const char *)text);
    2.13  	SDLTest_AssertPass("Call to SDL_SetClipboardText succeeded");
    2.14  	SDLTest_AssertCheck(
    2.15 @@ -128,7 +128,7 @@
    2.16  		"Verify result from SDL_SetClipboardText(NULL), expected 0, got %i",
    2.17  		intResult);
    2.18  	SDLTest_AssertCheck(
    2.19 -		strcmp(textRef, text) == 0,
    2.20 +		SDL_strcmp(textRef, text) == 0,
    2.21  		"Verify SDL_SetClipboardText did not modify input string, expected '%s', got '%s'",
    2.22  		textRef, text);
    2.23  	boolResult = SDL_HasClipboardText();
     3.1 --- a/test/testautomation_mouse.c	Wed Jan 23 08:03:19 2013 -0800
     3.2 +++ b/test/testautomation_mouse.c	Thu Jan 24 07:58:59 2013 -0800
     3.3 @@ -16,11 +16,11 @@
     3.4  int _mouseStateCheck(Uint8 state)
     3.5  {
     3.6    return (state == 0) || 
     3.7 -         SDL_BUTTON(SDL_BUTTON_LEFT) || 
     3.8 -         SDL_BUTTON(SDL_BUTTON_MIDDLE) || 
     3.9 -         SDL_BUTTON(SDL_BUTTON_RIGHT) || 
    3.10 -         SDL_BUTTON(SDL_BUTTON_X1) || 
    3.11 -         SDL_BUTTON(SDL_BUTTON_X2);
    3.12 +         (state == SDL_BUTTON(SDL_BUTTON_LEFT)) || 
    3.13 +         (state == SDL_BUTTON(SDL_BUTTON_MIDDLE)) || 
    3.14 +         (state == SDL_BUTTON(SDL_BUTTON_RIGHT)) || 
    3.15 +         (state == SDL_BUTTON(SDL_BUTTON_X1)) || 
    3.16 +         (state == SDL_BUTTON(SDL_BUTTON_X2));
    3.17  }
    3.18  
    3.19  /**
    3.20 @@ -215,6 +215,42 @@
    3.21  	return TEST_COMPLETED;
    3.22  }
    3.23  
    3.24 +/**
    3.25 + * @brief Check call to SDL_CreateColorCursor and SDL_FreeCursor
    3.26 + * 
    3.27 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_CreateColorCursor
    3.28 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_FreeCursor
    3.29 + */
    3.30 +int
    3.31 +mouse_createFreeColorCursor(void *arg)
    3.32 +{
    3.33 +	SDL_Surface *face;
    3.34 +	SDL_Cursor *cursor;	
    3.35 +
    3.36 +	/* Get sample surface */
    3.37 +	face = SDLTest_ImageFace();
    3.38 +	SDLTest_AssertCheck(face != NULL, "Validate sample input image is not NULL");
    3.39 +	if (face == NULL) return TEST_ABORTED; 
    3.40 +	
    3.41 +	/* Create a color cursor from surface */
    3.42 +	cursor = SDL_CreateColorCursor(face, 0, 0);
    3.43 +        SDLTest_AssertPass("Call to SDL_CreateColorCursor()");
    3.44 +        SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_CreateColorCursor() is not NULL");	
    3.45 +	if (cursor == NULL) {
    3.46 +		SDL_FreeSurface(face);
    3.47 +		return TEST_ABORTED;
    3.48 +	}
    3.49 +
    3.50 +	/* Free cursor again */
    3.51 +	SDL_FreeCursor(cursor);
    3.52 +	SDLTest_AssertPass("Call to SDL_FreeCursor()");
    3.53 +
    3.54 +	/* Clean up */
    3.55 +	SDL_FreeSurface(face);
    3.56 +	
    3.57 +	return TEST_COMPLETED;
    3.58 +}
    3.59 +
    3.60  /* Helper that changes cursor visibility */
    3.61  void _changeCursorVisibility(int state)
    3.62  {
    3.63 @@ -299,6 +335,80 @@
    3.64  	return TEST_COMPLETED;
    3.65  }
    3.66  
    3.67 +/**
    3.68 + * @brief Check call to SDL_GetCursor
    3.69 + * 
    3.70 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetCursor
    3.71 + */
    3.72 +int
    3.73 +mouse_getCursor(void *arg)
    3.74 +{
    3.75 +	SDL_Cursor *cursor;	
    3.76 +
    3.77 +	/* Get current cursor */
    3.78 +	cursor = SDL_GetCursor();
    3.79 +        SDLTest_AssertPass("Call to SDL_GetCursor()");
    3.80 +        SDLTest_AssertCheck(cursor != NULL, "Validate result from SDL_GetCursor() is not NULL");	
    3.81 +
    3.82 +	return TEST_COMPLETED;
    3.83 +}
    3.84 +
    3.85 +/**
    3.86 + * @brief Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode
    3.87 + * 
    3.88 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_GetRelativeMouseMode
    3.89 + * @sa http://wiki.libsdl.org/moin.cgi/SDL_SetRelativeMouseMode
    3.90 + */
    3.91 +int
    3.92 +mouse_getSetRelativeMouseMode(void *arg)
    3.93 +{
    3.94 +	int result;
    3.95 +        int i;
    3.96 +	SDL_bool initialState;
    3.97 +	SDL_bool currentState;
    3.98 +
    3.99 +	/* Capture original state so we can revert back to it later */
   3.100 +	initialState = SDL_GetRelativeMouseMode();
   3.101 +        SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
   3.102 +
   3.103 +        /* Repeat twice to check D->D transition */
   3.104 +        for (i=0; i<2; i++) {
   3.105 + 	  /* Disable - should always be supported */        
   3.106 +          result = SDL_SetRelativeMouseMode(SDL_FALSE);
   3.107 +          SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)");
   3.108 +          SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
   3.109 +	  currentState = SDL_GetRelativeMouseMode();
   3.110 +          SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
   3.111 +          SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState);
   3.112 +        }
   3.113 +        
   3.114 +        /* Repeat twice to check D->E->E transition */
   3.115 +        for (i=0; i<2; i++) {
   3.116 +  	  /* Enable - may not be supported */        
   3.117 +          result = SDL_SetRelativeMouseMode(SDL_TRUE);
   3.118 +          SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(TRUE)");
   3.119 +          if (result != -1) {
   3.120 +            SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
   3.121 +	    currentState = SDL_GetRelativeMouseMode();
   3.122 +            SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
   3.123 +            SDLTest_AssertCheck(currentState == SDL_TRUE, "Validate current state is TRUE, got: %i", currentState);
   3.124 +          }
   3.125 +        }
   3.126 +
   3.127 + 	/* Disable to check E->D transition */        
   3.128 +        result = SDL_SetRelativeMouseMode(SDL_FALSE);
   3.129 +        SDLTest_AssertPass("Call to SDL_SetRelativeMouseMode(FALSE)");
   3.130 +        SDLTest_AssertCheck(result == 0, "Validate result value from SDL_SetRelativeMouseMode, expected: 0, got: %i", result);
   3.131 +	currentState = SDL_GetRelativeMouseMode();
   3.132 +        SDLTest_AssertPass("Call to SDL_GetRelativeMouseMode()");
   3.133 +        SDLTest_AssertCheck(currentState == SDL_FALSE, "Validate current state is FALSE, got: %i", currentState);
   3.134 +        
   3.135 +        /* Revert to originl state - ignore result */
   3.136 +        result = SDL_SetRelativeMouseMode(initialState);
   3.137 +
   3.138 +	return TEST_COMPLETED;
   3.139 +}
   3.140 +
   3.141  #define MOUSE_TESTWINDOW_WIDTH	320
   3.142  #define MOUSE_TESTWINDOW_HEIGHT 200
   3.143  
   3.144 @@ -455,14 +565,24 @@
   3.145  		{ (SDLTest_TestCaseFp)mouse_setCursor, "mouse_setCursor", "Check call to SDL_SetCursor", TEST_ENABLED };
   3.146  
   3.147  static const SDLTest_TestCaseReference mouseTest6 =
   3.148 +		{ (SDLTest_TestCaseFp)mouse_getCursor, "mouse_getCursor", "Check call to SDL_GetCursor", TEST_ENABLED };
   3.149 +
   3.150 +static const SDLTest_TestCaseReference mouseTest7 =
   3.151  		{ (SDLTest_TestCaseFp)mouse_warpMouseInWindow, "mouse_warpMouseInWindow", "Check call to SDL_WarpMouseInWindow", TEST_ENABLED };
   3.152  
   3.153 -static const SDLTest_TestCaseReference mouseTest7 =
   3.154 +static const SDLTest_TestCaseReference mouseTest8 =
   3.155  		{ (SDLTest_TestCaseFp)mouse_getMouseFocus, "mouse_getMouseFocus", "Check call to SDL_getMouseFocus", TEST_ENABLED };
   3.156  
   3.157 +static const SDLTest_TestCaseReference mouseTest9 =
   3.158 +		{ (SDLTest_TestCaseFp)mouse_createFreeColorCursor, "mouse_createFreeColorCursor", "Check call to SDL_CreateColorCursor and SDL_FreeCursor", TEST_ENABLED };
   3.159 +
   3.160 +static const SDLTest_TestCaseReference mouseTest10 =
   3.161 +		{ (SDLTest_TestCaseFp)mouse_getSetRelativeMouseMode, "mouse_getSetRelativeMouseMode", "Check call to SDL_GetRelativeMouseMode and SDL_SetRelativeMouseMode", TEST_ENABLED };
   3.162 +
   3.163  /* Sequence of Mouse test cases */
   3.164  static const SDLTest_TestCaseReference *mouseTests[] =  {
   3.165 -	&mouseTest1, &mouseTest2, &mouseTest3, &mouseTest4, &mouseTest5, &mouseTest6, &mouseTest7, NULL
   3.166 +	&mouseTest1, &mouseTest2, &mouseTest3, &mouseTest4, &mouseTest5, &mouseTest6, 
   3.167 +	&mouseTest7, &mouseTest8, &mouseTest9, &mouseTest10, NULL
   3.168  };
   3.169  
   3.170  /* Mouse test suite (global) */
     4.1 --- a/test/testautomation_render.c	Wed Jan 23 08:03:19 2013 -0800
     4.2 +++ b/test/testautomation_render.c	Thu Jan 24 07:58:59 2013 -0800
     4.3 @@ -969,30 +969,37 @@
     4.4  static void
     4.5  _compare(SDL_Surface *referenceSurface, int allowable_error)
     4.6  {
     4.7 -   int ret;
     4.8 +   int result;
     4.9     SDL_Rect rect;
    4.10 -   Uint8 pix[4*TESTRENDER_SCREEN_W*TESTRENDER_SCREEN_H];
    4.11 +   Uint8 *pixels;
    4.12     SDL_Surface *testSurface;
    4.13  
    4.14     /* Read pixels. */
    4.15 +   pixels = (Uint8 *)SDL_malloc(4*TESTRENDER_SCREEN_W*TESTRENDER_SCREEN_H);
    4.16 +   SDLTest_AssertCheck(pixels != NULL, "Validate allocated temp pixel buffer");
    4.17 +   if (pixels == NULL) return;
    4.18 +
    4.19     /* Explicitly specify the rect in case the window isn't the expected size... */
    4.20     rect.x = 0;
    4.21     rect.y = 0;
    4.22     rect.w = TESTRENDER_SCREEN_W;
    4.23     rect.h = TESTRENDER_SCREEN_H;
    4.24 -   ret = SDL_RenderReadPixels(renderer, &rect, RENDER_COMPARE_FORMAT, pix, 80*4 );
    4.25 -   SDLTest_AssertCheck(ret == 0, "Validate result from SDL_RenderReadPixels, expected: 0, got: %i", ret);
    4.26 +   result = SDL_RenderReadPixels(renderer, &rect, RENDER_COMPARE_FORMAT, pixels, 80*4 );
    4.27 +   SDLTest_AssertCheck(result == 0, "Validate result from SDL_RenderReadPixels, expected: 0, got: %i", result);
    4.28  
    4.29     /* Create surface. */
    4.30 -   testSurface = SDL_CreateRGBSurfaceFrom( pix, TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, 32, TESTRENDER_SCREEN_W*4,
    4.31 +   testSurface = SDL_CreateRGBSurfaceFrom(pixels, TESTRENDER_SCREEN_W, TESTRENDER_SCREEN_H, 32, TESTRENDER_SCREEN_W*4,
    4.32                                         RENDER_COMPARE_RMASK, RENDER_COMPARE_GMASK, RENDER_COMPARE_BMASK, RENDER_COMPARE_AMASK);
    4.33 -   SDLTest_AssertCheck(testSurface != NULL, "Verify result from SDL_CreateRGBSurfaceFrom");
    4.34 +   SDLTest_AssertCheck(testSurface != NULL, "Verify result from SDL_CreateRGBSurfaceFrom is not NULL");
    4.35  
    4.36     /* Compare surface. */
    4.37 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, allowable_error );
    4.38 -   SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    4.39 +   result = SDLTest_CompareSurfaces( testSurface, referenceSurface, allowable_error );
    4.40 +   SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result);
    4.41  
    4.42     /* Clean up. */
    4.43 +   if (pixels != NULL) {
    4.44 +	   SDL_free(pixels);
    4.45 +   }
    4.46     if (testSurface != NULL) {
    4.47         SDL_FreeSurface(testSurface);
    4.48     }
     5.1 --- a/test/testautomation_surface.c	Wed Jan 23 08:03:19 2013 -0800
     5.2 +++ b/test/testautomation_surface.c	Thu Jan 24 07:58:59 2013 -0800
     5.3 @@ -326,19 +326,19 @@
     5.4  surface_testBlit(void *arg)
     5.5  {
     5.6     int ret;
     5.7 -   SDL_Surface *referenceSurface;
     5.8 +   SDL_Surface *compareSurface;
     5.9  
    5.10     /* Basic blitting */ 
    5.11     _testBlitBlendMode(-1);
    5.12     
    5.13     /* Verify result by comparing surfaces */
    5.14 -   referenceSurface = SDLTest_ImageBlit();
    5.15 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    5.16 +   compareSurface = SDLTest_ImageBlit();
    5.17 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
    5.18     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    5.19     
    5.20     /* Clean up. */
    5.21 -   if (referenceSurface != NULL) {   
    5.22 -   	SDL_FreeSurface( referenceSurface );
    5.23 +   if (compareSurface != NULL) {   
    5.24 +   	SDL_FreeSurface( compareSurface );
    5.25     }
    5.26  
    5.27     return TEST_COMPLETED;
    5.28 @@ -351,19 +351,19 @@
    5.29  surface_testBlitColorMod(void *arg)
    5.30  {
    5.31     int ret;
    5.32 -   SDL_Surface *referenceSurface;
    5.33 +   SDL_Surface *compareSurface;
    5.34  
    5.35     /* Basic blitting with color mod */ 
    5.36     _testBlitBlendMode(-2);
    5.37     
    5.38     /* Verify result by comparing surfaces */
    5.39 -   referenceSurface = SDLTest_ImageBlitColor();
    5.40 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    5.41 +   compareSurface = SDLTest_ImageBlitColor();
    5.42 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
    5.43     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    5.44     
    5.45     /* Clean up. */
    5.46 -   if (referenceSurface != NULL) {   
    5.47 -   	SDL_FreeSurface( referenceSurface );
    5.48 +   if (compareSurface != NULL) {   
    5.49 +   	SDL_FreeSurface( compareSurface );
    5.50     }
    5.51  
    5.52     return TEST_COMPLETED;
    5.53 @@ -376,19 +376,19 @@
    5.54  surface_testBlitAlphaMod(void *arg)
    5.55  {
    5.56     int ret;
    5.57 -   SDL_Surface *referenceSurface;
    5.58 +   SDL_Surface *compareSurface;
    5.59  
    5.60     /* Basic blitting with alpha mod */ 
    5.61     _testBlitBlendMode(-3);
    5.62     
    5.63     /* Verify result by comparing surfaces */
    5.64 -   referenceSurface = SDLTest_ImageBlitAlpha();
    5.65 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    5.66 +   compareSurface = SDLTest_ImageBlitAlpha();
    5.67 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
    5.68     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    5.69     
    5.70     /* Clean up. */
    5.71 -   if (referenceSurface != NULL) {   
    5.72 -   	SDL_FreeSurface( referenceSurface );
    5.73 +   if (compareSurface != NULL) {   
    5.74 +   	SDL_FreeSurface( compareSurface );
    5.75     }
    5.76  
    5.77     return TEST_COMPLETED;
    5.78 @@ -402,19 +402,19 @@
    5.79  surface_testBlitBlendNone(void *arg)
    5.80  {
    5.81     int ret;
    5.82 -   SDL_Surface *referenceSurface;
    5.83 +   SDL_Surface *compareSurface;
    5.84  
    5.85     /* Basic blitting */ 
    5.86     _testBlitBlendMode(SDL_BLENDMODE_NONE);
    5.87     
    5.88     /* Verify result by comparing surfaces */
    5.89 -   referenceSurface = SDLTest_ImageBlitBlendNone();
    5.90 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
    5.91 +   compareSurface = SDLTest_ImageBlitBlendNone();
    5.92 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
    5.93     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
    5.94     
    5.95     /* Clean up. */
    5.96 -   if (referenceSurface != NULL) {   
    5.97 -   	SDL_FreeSurface( referenceSurface );
    5.98 +   if (compareSurface != NULL) {   
    5.99 +   	SDL_FreeSurface( compareSurface );
   5.100     }
   5.101  
   5.102     return TEST_COMPLETED;
   5.103 @@ -427,19 +427,19 @@
   5.104  surface_testBlitBlendBlend(void *arg)
   5.105  {
   5.106     int ret;
   5.107 -   SDL_Surface *referenceSurface;
   5.108 +   SDL_Surface *compareSurface;
   5.109  
   5.110     /* Blend blitting */ 
   5.111     _testBlitBlendMode(SDL_BLENDMODE_BLEND);
   5.112     
   5.113     /* Verify result by comparing surfaces */
   5.114 -   referenceSurface = SDLTest_ImageBlitBlend();
   5.115 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
   5.116 +   compareSurface = SDLTest_ImageBlitBlend();
   5.117 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   5.118     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   5.119     
   5.120     /* Clean up. */
   5.121 -   if (referenceSurface != NULL) {   
   5.122 -   	SDL_FreeSurface( referenceSurface );
   5.123 +   if (compareSurface != NULL) {   
   5.124 +   	SDL_FreeSurface( compareSurface );
   5.125     }
   5.126  
   5.127     return TEST_COMPLETED;
   5.128 @@ -452,19 +452,19 @@
   5.129  surface_testBlitBlendAdd(void *arg)
   5.130  {
   5.131     int ret;
   5.132 -   SDL_Surface *referenceSurface;
   5.133 +   SDL_Surface *compareSurface;
   5.134  
   5.135     /* Add blitting */ 
   5.136     _testBlitBlendMode(SDL_BLENDMODE_ADD);
   5.137     
   5.138     /* Verify result by comparing surfaces */
   5.139 -   referenceSurface = SDLTest_ImageBlitBlendAdd();
   5.140 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
   5.141 +   compareSurface = SDLTest_ImageBlitBlendAdd();
   5.142 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   5.143     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   5.144     
   5.145     /* Clean up. */
   5.146 -   if (referenceSurface != NULL) {   
   5.147 -   	SDL_FreeSurface( referenceSurface );
   5.148 +   if (compareSurface != NULL) {   
   5.149 +   	SDL_FreeSurface( compareSurface );
   5.150     }
   5.151  
   5.152     return TEST_COMPLETED;
   5.153 @@ -477,19 +477,19 @@
   5.154  surface_testBlitBlendMod(void *arg)
   5.155  {
   5.156     int ret;
   5.157 -   SDL_Surface *referenceSurface;
   5.158 +   SDL_Surface *compareSurface;
   5.159  
   5.160     /* Mod blitting */ 
   5.161     _testBlitBlendMode(SDL_BLENDMODE_MOD);
   5.162     
   5.163     /* Verify result by comparing surfaces */
   5.164 -   referenceSurface = SDLTest_ImageBlitBlendMod();
   5.165 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
   5.166 +   compareSurface = SDLTest_ImageBlitBlendMod();
   5.167 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   5.168     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   5.169     
   5.170     /* Clean up. */
   5.171 -   if (referenceSurface != NULL) {   
   5.172 -   	SDL_FreeSurface( referenceSurface );
   5.173 +   if (compareSurface != NULL) {   
   5.174 +   	  SDL_FreeSurface( compareSurface );
   5.175     }
   5.176  
   5.177     return TEST_COMPLETED;
   5.178 @@ -502,19 +502,19 @@
   5.179  surface_testBlitBlendLoop(void *arg) {
   5.180  
   5.181     int ret;
   5.182 -   SDL_Surface *referenceSurface;
   5.183 +   SDL_Surface *compareSurface;
   5.184  
   5.185     /* All blitting modes */ 
   5.186     _testBlitBlendMode(-4);
   5.187     
   5.188     /* Verify result by comparing surfaces */
   5.189 -   referenceSurface = SDLTest_ImageBlitBlendAll();
   5.190 -   ret = SDLTest_CompareSurfaces( testSurface, referenceSurface, 0 );
   5.191 +   compareSurface = SDLTest_ImageBlitBlendAll();
   5.192 +   ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   5.193     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   5.194     
   5.195     /* Clean up. */
   5.196 -   if (referenceSurface != NULL) {   
   5.197 -   	SDL_FreeSurface( referenceSurface );
   5.198 +   if (compareSurface != NULL) {   
   5.199 +   	 SDL_FreeSurface(compareSurface);
   5.200     }
   5.201  
   5.202     return TEST_COMPLETED;