test/testautomation_surface.c
changeset 7191 75360622e65f
parent 7176 66cf9f85494e
child 7374 29ace61fca99
     1.1 --- a/test/testautomation_surface.c	Sat May 18 12:48:50 2013 -0700
     1.2 +++ b/test/testautomation_surface.c	Sat May 18 14:17:52 2013 -0700
     1.3 @@ -56,21 +56,21 @@
     1.4        SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result);
     1.5        result = SDL_GetSurfaceBlendMode(testSurface, &currentBlendMode);
     1.6        SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result);
     1.7 -      SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %i, got: %i", blendMode, currentBlendMode);      
     1.8 +      SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %i, got: %i", blendMode, currentBlendMode);
     1.9      }
    1.10  }
    1.11  
    1.12  void
    1.13  _surfaceTearDown(void *arg)
    1.14  {
    1.15 -	if (referenceSurface != NULL) {
    1.16 -		SDL_FreeSurface(referenceSurface);
    1.17 -		referenceSurface = NULL;
    1.18 -	}
    1.19 -	if (testSurface != NULL) {
    1.20 -		SDL_FreeSurface(testSurface);
    1.21 -		testSurface = NULL;
    1.22 -	}
    1.23 +    if (referenceSurface != NULL) {
    1.24 +        SDL_FreeSurface(referenceSurface);
    1.25 +        referenceSurface = NULL;
    1.26 +    }
    1.27 +    if (testSurface != NULL) {
    1.28 +        SDL_FreeSurface(testSurface);
    1.29 +        testSurface = NULL;
    1.30 +    }
    1.31  }
    1.32  
    1.33  /**
    1.34 @@ -78,15 +78,15 @@
    1.35   */
    1.36  void _clearTestSurface()
    1.37  {
    1.38 -	int ret;
    1.39 -	Uint32 color;
    1.40 +    int ret;
    1.41 +    Uint32 color;
    1.42  
    1.43 -	/* Clear surface. */
    1.44 -	color = SDL_MapRGBA( testSurface->format, 0, 0, 0, 0);
    1.45 -	SDLTest_AssertPass("Call to SDL_MapRGBA()");
    1.46 -	ret = SDL_FillRect( testSurface, NULL, color);
    1.47 -	SDLTest_AssertPass("Call to SDL_FillRect()");
    1.48 -	SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillRect, expected: 0, got: %i", ret);
    1.49 +    /* Clear surface. */
    1.50 +    color = SDL_MapRGBA( testSurface->format, 0, 0, 0, 0);
    1.51 +    SDLTest_AssertPass("Call to SDL_MapRGBA()");
    1.52 +    ret = SDL_FillRect( testSurface, NULL, color);
    1.53 +    SDLTest_AssertPass("Call to SDL_FillRect()");
    1.54 +    SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillRect, expected: 0, got: %i", ret);
    1.55  }
    1.56  
    1.57  /**
    1.58 @@ -94,119 +94,119 @@
    1.59   */
    1.60  void _testBlitBlendMode(int mode)
    1.61  {
    1.62 -	int ret;
    1.63 -	int i, j, ni, nj;
    1.64 -	SDL_Surface *face;
    1.65 -	SDL_Rect rect;
    1.66 -	int nmode;
    1.67 -	SDL_BlendMode bmode;
    1.68 -	int checkFailCount1;
    1.69 -	int checkFailCount2;
    1.70 -	int checkFailCount3;
    1.71 -	int checkFailCount4;
    1.72 +    int ret;
    1.73 +    int i, j, ni, nj;
    1.74 +    SDL_Surface *face;
    1.75 +    SDL_Rect rect;
    1.76 +    int nmode;
    1.77 +    SDL_BlendMode bmode;
    1.78 +    int checkFailCount1;
    1.79 +    int checkFailCount2;
    1.80 +    int checkFailCount3;
    1.81 +    int checkFailCount4;
    1.82  
    1.83 -	/* Check test surface */
    1.84 -	SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL");
    1.85 -	if (testSurface == NULL) return;
    1.86 -	
    1.87 -	/* Create sample surface */
    1.88 -	face = SDLTest_ImageFace();
    1.89 -	SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL");
    1.90 -	if (face == NULL) return;
    1.91 +    /* Check test surface */
    1.92 +    SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL");
    1.93 +    if (testSurface == NULL) return;
    1.94  
    1.95 -        /* Reset alpha modulation */	
    1.96 -	ret = SDL_SetSurfaceAlphaMod(face, 255);
    1.97 -	SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()");
    1.98 -	SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret);
    1.99 +    /* Create sample surface */
   1.100 +    face = SDLTest_ImageFace();
   1.101 +    SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL");
   1.102 +    if (face == NULL) return;
   1.103  
   1.104 -        /* Reset color modulation */	
   1.105 -	ret = SDL_SetSurfaceColorMod(face, 255, 255, 255);
   1.106 -	SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()");
   1.107 -	SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret);
   1.108 +        /* Reset alpha modulation */
   1.109 +    ret = SDL_SetSurfaceAlphaMod(face, 255);
   1.110 +    SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()");
   1.111 +    SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret);
   1.112  
   1.113 -        /* Reset color key */	
   1.114 -	ret = SDL_SetColorKey(face, SDL_FALSE, 0);
   1.115 -	SDLTest_AssertPass("Call to SDL_SetColorKey()");
   1.116 -	SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey(), expected: 0, got: %i", ret);
   1.117 +        /* Reset color modulation */
   1.118 +    ret = SDL_SetSurfaceColorMod(face, 255, 255, 255);
   1.119 +    SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()");
   1.120 +    SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret);
   1.121  
   1.122 -	/* Clear the test surface */
   1.123 +        /* Reset color key */
   1.124 +    ret = SDL_SetColorKey(face, SDL_FALSE, 0);
   1.125 +    SDLTest_AssertPass("Call to SDL_SetColorKey()");
   1.126 +    SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey(), expected: 0, got: %i", ret);
   1.127 +
   1.128 +    /* Clear the test surface */
   1.129          _clearTestSurface();
   1.130 -        
   1.131 -	/* Target rect size */
   1.132 -	rect.w = face->w;
   1.133 -	rect.h = face->h;
   1.134 -	
   1.135 -	/* Steps to take */
   1.136 -	ni = testSurface->w - face->w;
   1.137 -	nj = testSurface->h - face->h;
   1.138  
   1.139 -	/* Optionally set blend mode. */
   1.140 -	if (mode >= 0) {
   1.141 -		ret = SDL_SetSurfaceBlendMode( face, (SDL_BlendMode)mode );
   1.142 -		SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()");
   1.143 -		SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret);
   1.144 -	}
   1.145 -	
   1.146 -	/* Test blend mode. */
   1.147 -	checkFailCount1 = 0;
   1.148 -	checkFailCount2 = 0;
   1.149 -	checkFailCount3 = 0;
   1.150 -	checkFailCount4 = 0;
   1.151 -	for (j=0; j <= nj; j+=4) {
   1.152 -	  for (i=0; i <= ni; i+=4) {
   1.153 -	  	if (mode == -2) {
   1.154 -			/* Set color mod. */
   1.155 -			ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j );
   1.156 -			if (ret != 0) checkFailCount2++;
   1.157 -		}
   1.158 -	  	else if (mode == -3) {
   1.159 -	  		/* Set alpha mod. */
   1.160 -			ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i );
   1.161 -			if (ret != 0) checkFailCount3++;
   1.162 -		}
   1.163 -		else if (mode == -4) {
   1.164 -			/* Crazy blending mode magic. */
   1.165 -			nmode = (i/4*j/4) % 4;
   1.166 -			if (nmode==0) {
   1.167 -				bmode = SDL_BLENDMODE_NONE;
   1.168 -			} else if (nmode==1) {
   1.169 -				bmode = SDL_BLENDMODE_BLEND;
   1.170 -			} else if (nmode==2) {
   1.171 -				bmode = SDL_BLENDMODE_ADD;				
   1.172 -			} else if (nmode==3) {
   1.173 -				bmode = SDL_BLENDMODE_MOD;
   1.174 -			}
   1.175 -			ret = SDL_SetSurfaceBlendMode( face, bmode );
   1.176 -			if (ret != 0) checkFailCount4++;
   1.177 -		}
   1.178 +    /* Target rect size */
   1.179 +    rect.w = face->w;
   1.180 +    rect.h = face->h;
   1.181  
   1.182 -		 /* Blitting. */
   1.183 -		 rect.x = i;
   1.184 -		 rect.y = j;
   1.185 -		 ret = SDL_BlitSurface( face, NULL, testSurface, &rect );
   1.186 -		 if (ret != 0) checkFailCount1++;
   1.187 -	  }
   1.188 -	}
   1.189 -	SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1);
   1.190 -	SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2);
   1.191 -	SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3);
   1.192 -	SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4);
   1.193 -	
   1.194 -	/* Clean up */
   1.195 -	if (face != NULL) {
   1.196 -		SDL_FreeSurface(face);
   1.197 -		face = NULL;
   1.198 -	}
   1.199 +    /* Steps to take */
   1.200 +    ni = testSurface->w - face->w;
   1.201 +    nj = testSurface->h - face->h;
   1.202 +
   1.203 +    /* Optionally set blend mode. */
   1.204 +    if (mode >= 0) {
   1.205 +        ret = SDL_SetSurfaceBlendMode( face, (SDL_BlendMode)mode );
   1.206 +        SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()");
   1.207 +        SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret);
   1.208 +    }
   1.209 +
   1.210 +    /* Test blend mode. */
   1.211 +    checkFailCount1 = 0;
   1.212 +    checkFailCount2 = 0;
   1.213 +    checkFailCount3 = 0;
   1.214 +    checkFailCount4 = 0;
   1.215 +    for (j=0; j <= nj; j+=4) {
   1.216 +      for (i=0; i <= ni; i+=4) {
   1.217 +        if (mode == -2) {
   1.218 +            /* Set color mod. */
   1.219 +            ret = SDL_SetSurfaceColorMod( face, (255/nj)*j, (255/ni)*i, (255/nj)*j );
   1.220 +            if (ret != 0) checkFailCount2++;
   1.221 +        }
   1.222 +        else if (mode == -3) {
   1.223 +            /* Set alpha mod. */
   1.224 +            ret = SDL_SetSurfaceAlphaMod( face, (255/ni)*i );
   1.225 +            if (ret != 0) checkFailCount3++;
   1.226 +        }
   1.227 +        else if (mode == -4) {
   1.228 +            /* Crazy blending mode magic. */
   1.229 +            nmode = (i/4*j/4) % 4;
   1.230 +            if (nmode==0) {
   1.231 +                bmode = SDL_BLENDMODE_NONE;
   1.232 +            } else if (nmode==1) {
   1.233 +                bmode = SDL_BLENDMODE_BLEND;
   1.234 +            } else if (nmode==2) {
   1.235 +                bmode = SDL_BLENDMODE_ADD;
   1.236 +            } else if (nmode==3) {
   1.237 +                bmode = SDL_BLENDMODE_MOD;
   1.238 +            }
   1.239 +            ret = SDL_SetSurfaceBlendMode( face, bmode );
   1.240 +            if (ret != 0) checkFailCount4++;
   1.241 +        }
   1.242 +
   1.243 +         /* Blitting. */
   1.244 +         rect.x = i;
   1.245 +         rect.y = j;
   1.246 +         ret = SDL_BlitSurface( face, NULL, testSurface, &rect );
   1.247 +         if (ret != 0) checkFailCount1++;
   1.248 +      }
   1.249 +    }
   1.250 +    SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1);
   1.251 +    SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2);
   1.252 +    SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3);
   1.253 +    SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4);
   1.254 +
   1.255 +    /* Clean up */
   1.256 +    if (face != NULL) {
   1.257 +        SDL_FreeSurface(face);
   1.258 +        face = NULL;
   1.259 +    }
   1.260  }
   1.261  
   1.262  /* Helper to check that a file exists */
   1.263  void
   1.264  _AssertFileExist(const char *filename)
   1.265  {
   1.266 -	struct stat st;
   1.267 -	int ret = stat(filename, &st);
   1.268 +    struct stat st;
   1.269 +    int ret = stat(filename, &st);
   1.270  
   1.271 -	SDLTest_AssertCheck(ret == 0, "Verify file '%s' exists", filename);
   1.272 +    SDLTest_AssertCheck(ret == 0, "Verify file '%s' exists", filename);
   1.273  }
   1.274  
   1.275  
   1.276 @@ -234,16 +234,16 @@
   1.277      /* Save a surface */
   1.278      ret = SDL_SaveBMP(face, sampleFilename);
   1.279      SDLTest_AssertPass("Call to SDL_SaveBMP()");
   1.280 -    SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SaveBMP, expected: 0, got: %i", ret); 
   1.281 +    SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SaveBMP, expected: 0, got: %i", ret);
   1.282      _AssertFileExist(sampleFilename);
   1.283 -    	
   1.284 +
   1.285      /* Load a surface */
   1.286      rface = SDL_LoadBMP(sampleFilename);
   1.287      SDLTest_AssertPass("Call to SDL_LoadBMP()");
   1.288      SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_LoadBMP is not NULL");
   1.289      if (rface != NULL) {
   1.290 -	    SDLTest_AssertCheck(face->w == rface->w, "Verify width of loaded surface, expected: %i, got: %i", face->w, rface->w);
   1.291 -	    SDLTest_AssertCheck(face->h == rface->h, "Verify height of loaded surface, expected: %i, got: %i", face->h, rface->h);
   1.292 +        SDLTest_AssertCheck(face->w == rface->w, "Verify width of loaded surface, expected: %i, got: %i", face->w, rface->w);
   1.293 +        SDLTest_AssertCheck(face->h == rface->h, "Verify height of loaded surface, expected: %i, got: %i", face->h, rface->h);
   1.294      }
   1.295  
   1.296      /* Delete test file; ignore errors */
   1.297 @@ -251,14 +251,14 @@
   1.298  
   1.299      /* Clean up */
   1.300      if (face != NULL) {
   1.301 -	SDL_FreeSurface(face);
   1.302 -	face = NULL;
   1.303 +    SDL_FreeSurface(face);
   1.304 +    face = NULL;
   1.305      }
   1.306      if (rface != NULL) {
   1.307 -	SDL_FreeSurface(rface);
   1.308 -	rface = NULL;
   1.309 +    SDL_FreeSurface(rface);
   1.310 +    rface = NULL;
   1.311      }
   1.312 -    
   1.313 +
   1.314      return TEST_COMPLETED;
   1.315  }
   1.316  
   1.317 @@ -268,42 +268,42 @@
   1.318  int
   1.319  surface_testSurfaceConversion(void *arg)
   1.320  {
   1.321 -	SDL_Surface *rface = NULL, *face = NULL;
   1.322 -	int ret = 0;
   1.323 +    SDL_Surface *rface = NULL, *face = NULL;
   1.324 +    int ret = 0;
   1.325  
   1.326 -	/* Create sample surface */
   1.327 -	face = SDLTest_ImageFace();
   1.328 -	SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL");
   1.329 -	if (face == NULL) 
   1.330 -		return TEST_ABORTED;
   1.331 +    /* Create sample surface */
   1.332 +    face = SDLTest_ImageFace();
   1.333 +    SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL");
   1.334 +    if (face == NULL)
   1.335 +        return TEST_ABORTED;
   1.336  
   1.337 -	/* Set transparent pixel as the pixel at (0,0) */
   1.338 -	if (face->format->palette) {
   1.339 -	   ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels);
   1.340 -	   SDLTest_AssertPass("Call to SDL_SetColorKey()");
   1.341 -	   SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret);
   1.342 -	}
   1.343 +    /* Set transparent pixel as the pixel at (0,0) */
   1.344 +    if (face->format->palette) {
   1.345 +       ret = SDL_SetColorKey(face, SDL_RLEACCEL, *(Uint8 *) face->pixels);
   1.346 +       SDLTest_AssertPass("Call to SDL_SetColorKey()");
   1.347 +       SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetColorKey, expected: 0, got: %i", ret);
   1.348 +    }
   1.349  
   1.350 -	/* Convert to 32 bit to compare. */
   1.351 -	rface = SDL_ConvertSurface( face, testSurface->format, 0 );
   1.352 -	SDLTest_AssertPass("Call to SDL_ConvertSurface()");
   1.353 -	SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_ConvertSurface is not NULL");
   1.354 +    /* Convert to 32 bit to compare. */
   1.355 +    rface = SDL_ConvertSurface( face, testSurface->format, 0 );
   1.356 +    SDLTest_AssertPass("Call to SDL_ConvertSurface()");
   1.357 +    SDLTest_AssertCheck(rface != NULL, "Verify result from SDL_ConvertSurface is not NULL");
   1.358  
   1.359 -	/* Compare surface. */
   1.360 -	ret = SDLTest_CompareSurfaces( rface, face, 0 );
   1.361 -	SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.362 -	
   1.363 -	/* Clean up. */
   1.364 -	if (face != NULL) {
   1.365 -		SDL_FreeSurface( face );
   1.366 -		face = NULL;
   1.367 -	}
   1.368 -	if (rface != NULL) {
   1.369 -		SDL_FreeSurface( rface );
   1.370 -		rface = NULL;
   1.371 -	}	
   1.372 +    /* Compare surface. */
   1.373 +    ret = SDLTest_CompareSurfaces( rface, face, 0 );
   1.374 +    SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.375  
   1.376 -	return TEST_COMPLETED;
   1.377 +    /* Clean up. */
   1.378 +    if (face != NULL) {
   1.379 +        SDL_FreeSurface( face );
   1.380 +        face = NULL;
   1.381 +    }
   1.382 +    if (rface != NULL) {
   1.383 +        SDL_FreeSurface( rface );
   1.384 +        rface = NULL;
   1.385 +    }
   1.386 +
   1.387 +    return TEST_COMPLETED;
   1.388  }
   1.389  
   1.390  
   1.391 @@ -313,10 +313,10 @@
   1.392  int
   1.393  surface_testLoadFailure(void *arg)
   1.394  {
   1.395 -	SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp");
   1.396 -	SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp");
   1.397 +    SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp");
   1.398 +    SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp");
   1.399  
   1.400 -	return TEST_COMPLETED;
   1.401 +    return TEST_COMPLETED;
   1.402  }
   1.403  
   1.404  /**
   1.405 @@ -328,17 +328,17 @@
   1.406     int ret;
   1.407     SDL_Surface *compareSurface;
   1.408  
   1.409 -   /* Basic blitting */ 
   1.410 +   /* Basic blitting */
   1.411     _testBlitBlendMode(-1);
   1.412 -   
   1.413 +
   1.414     /* Verify result by comparing surfaces */
   1.415     compareSurface = SDLTest_ImageBlit();
   1.416     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.417     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.418 -   
   1.419 +
   1.420     /* Clean up. */
   1.421 -   if (compareSurface != NULL) {   
   1.422 -   	SDL_FreeSurface( compareSurface );
   1.423 +   if (compareSurface != NULL) {
   1.424 +    SDL_FreeSurface( compareSurface );
   1.425     }
   1.426  
   1.427     return TEST_COMPLETED;
   1.428 @@ -353,17 +353,17 @@
   1.429     int ret;
   1.430     SDL_Surface *compareSurface;
   1.431  
   1.432 -   /* Basic blitting with color mod */ 
   1.433 +   /* Basic blitting with color mod */
   1.434     _testBlitBlendMode(-2);
   1.435 -   
   1.436 +
   1.437     /* Verify result by comparing surfaces */
   1.438     compareSurface = SDLTest_ImageBlitColor();
   1.439     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.440     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.441 -   
   1.442 +
   1.443     /* Clean up. */
   1.444 -   if (compareSurface != NULL) {   
   1.445 -   	SDL_FreeSurface( compareSurface );
   1.446 +   if (compareSurface != NULL) {
   1.447 +    SDL_FreeSurface( compareSurface );
   1.448     }
   1.449  
   1.450     return TEST_COMPLETED;
   1.451 @@ -378,17 +378,17 @@
   1.452     int ret;
   1.453     SDL_Surface *compareSurface;
   1.454  
   1.455 -   /* Basic blitting with alpha mod */ 
   1.456 +   /* Basic blitting with alpha mod */
   1.457     _testBlitBlendMode(-3);
   1.458 -   
   1.459 +
   1.460     /* Verify result by comparing surfaces */
   1.461     compareSurface = SDLTest_ImageBlitAlpha();
   1.462     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.463     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.464 -   
   1.465 +
   1.466     /* Clean up. */
   1.467 -   if (compareSurface != NULL) {   
   1.468 -   	SDL_FreeSurface( compareSurface );
   1.469 +   if (compareSurface != NULL) {
   1.470 +    SDL_FreeSurface( compareSurface );
   1.471     }
   1.472  
   1.473     return TEST_COMPLETED;
   1.474 @@ -404,17 +404,17 @@
   1.475     int ret;
   1.476     SDL_Surface *compareSurface;
   1.477  
   1.478 -   /* Basic blitting */ 
   1.479 +   /* Basic blitting */
   1.480     _testBlitBlendMode(SDL_BLENDMODE_NONE);
   1.481 -   
   1.482 +
   1.483     /* Verify result by comparing surfaces */
   1.484     compareSurface = SDLTest_ImageBlitBlendNone();
   1.485     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.486     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.487 -   
   1.488 +
   1.489     /* Clean up. */
   1.490 -   if (compareSurface != NULL) {   
   1.491 -   	SDL_FreeSurface( compareSurface );
   1.492 +   if (compareSurface != NULL) {
   1.493 +    SDL_FreeSurface( compareSurface );
   1.494     }
   1.495  
   1.496     return TEST_COMPLETED;
   1.497 @@ -429,17 +429,17 @@
   1.498     int ret;
   1.499     SDL_Surface *compareSurface;
   1.500  
   1.501 -   /* Blend blitting */ 
   1.502 +   /* Blend blitting */
   1.503     _testBlitBlendMode(SDL_BLENDMODE_BLEND);
   1.504 -   
   1.505 +
   1.506     /* Verify result by comparing surfaces */
   1.507     compareSurface = SDLTest_ImageBlitBlend();
   1.508     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.509     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.510 -   
   1.511 +
   1.512     /* Clean up. */
   1.513 -   if (compareSurface != NULL) {   
   1.514 -   	SDL_FreeSurface( compareSurface );
   1.515 +   if (compareSurface != NULL) {
   1.516 +    SDL_FreeSurface( compareSurface );
   1.517     }
   1.518  
   1.519     return TEST_COMPLETED;
   1.520 @@ -454,17 +454,17 @@
   1.521     int ret;
   1.522     SDL_Surface *compareSurface;
   1.523  
   1.524 -   /* Add blitting */ 
   1.525 +   /* Add blitting */
   1.526     _testBlitBlendMode(SDL_BLENDMODE_ADD);
   1.527 -   
   1.528 +
   1.529     /* Verify result by comparing surfaces */
   1.530     compareSurface = SDLTest_ImageBlitBlendAdd();
   1.531     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.532     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.533 -   
   1.534 +
   1.535     /* Clean up. */
   1.536 -   if (compareSurface != NULL) {   
   1.537 -   	SDL_FreeSurface( compareSurface );
   1.538 +   if (compareSurface != NULL) {
   1.539 +    SDL_FreeSurface( compareSurface );
   1.540     }
   1.541  
   1.542     return TEST_COMPLETED;
   1.543 @@ -479,17 +479,17 @@
   1.544     int ret;
   1.545     SDL_Surface *compareSurface;
   1.546  
   1.547 -   /* Mod blitting */ 
   1.548 +   /* Mod blitting */
   1.549     _testBlitBlendMode(SDL_BLENDMODE_MOD);
   1.550 -   
   1.551 +
   1.552     /* Verify result by comparing surfaces */
   1.553     compareSurface = SDLTest_ImageBlitBlendMod();
   1.554     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.555     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.556 -   
   1.557 +
   1.558     /* Clean up. */
   1.559 -   if (compareSurface != NULL) {   
   1.560 -   	  SDL_FreeSurface( compareSurface );
   1.561 +   if (compareSurface != NULL) {
   1.562 +      SDL_FreeSurface( compareSurface );
   1.563     }
   1.564  
   1.565     return TEST_COMPLETED;
   1.566 @@ -504,17 +504,17 @@
   1.567     int ret;
   1.568     SDL_Surface *compareSurface;
   1.569  
   1.570 -   /* All blitting modes */ 
   1.571 +   /* All blitting modes */
   1.572     _testBlitBlendMode(-4);
   1.573 -   
   1.574 +
   1.575     /* Verify result by comparing surfaces */
   1.576     compareSurface = SDLTest_ImageBlitBlendAll();
   1.577     ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 );
   1.578     SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret);
   1.579 -   
   1.580 +
   1.581     /* Clean up. */
   1.582 -   if (compareSurface != NULL) {   
   1.583 -   	 SDL_FreeSurface(compareSurface);
   1.584 +   if (compareSurface != NULL) {
   1.585 +     SDL_FreeSurface(compareSurface);
   1.586     }
   1.587  
   1.588     return TEST_COMPLETED;
   1.589 @@ -525,52 +525,52 @@
   1.590  
   1.591  /* Surface test cases */
   1.592  static const SDLTest_TestCaseReference surfaceTest1 =
   1.593 -		{ (SDLTest_TestCaseFp)surface_testSaveLoadBitmap, "surface_testSaveLoadBitmap", "Tests sprite saving and loading.", TEST_ENABLED};
   1.594 +        { (SDLTest_TestCaseFp)surface_testSaveLoadBitmap, "surface_testSaveLoadBitmap", "Tests sprite saving and loading.", TEST_ENABLED};
   1.595  
   1.596  static const SDLTest_TestCaseReference surfaceTest2 =
   1.597 -		{ (SDLTest_TestCaseFp)surface_testBlit, "surface_testBlit", "Tests basic blitting.", TEST_ENABLED};
   1.598 +        { (SDLTest_TestCaseFp)surface_testBlit, "surface_testBlit", "Tests basic blitting.", TEST_ENABLED};
   1.599  
   1.600  static const SDLTest_TestCaseReference surfaceTest3 =
   1.601 -		{ (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED};
   1.602 +        { (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED};
   1.603  
   1.604  static const SDLTest_TestCaseReference surfaceTest4 =
   1.605 -		{ (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED};
   1.606 +        { (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED};
   1.607  
   1.608  static const SDLTest_TestCaseReference surfaceTest5 =
   1.609 -		{ (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED};
   1.610 +        { (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED};
   1.611  
   1.612  static const SDLTest_TestCaseReference surfaceTest6 =
   1.613 -		{ (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED};
   1.614 +        { (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED};
   1.615  
   1.616  static const SDLTest_TestCaseReference surfaceTest7 =
   1.617 -		{ (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED};
   1.618 +        { (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED};
   1.619  
   1.620  /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */
   1.621  static const SDLTest_TestCaseReference surfaceTest8 =
   1.622 -		{ (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blittin routines with verious blending modes", TEST_DISABLED};
   1.623 +        { (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blittin routines with verious blending modes", TEST_DISABLED};
   1.624  
   1.625  /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */
   1.626  static const SDLTest_TestCaseReference surfaceTest9 =
   1.627 -		{ (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_DISABLED};
   1.628 +        { (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_DISABLED};
   1.629  
   1.630  /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */
   1.631  static const SDLTest_TestCaseReference surfaceTest10 =
   1.632 -		{ (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED};
   1.633 +        { (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED};
   1.634  
   1.635  static const SDLTest_TestCaseReference surfaceTest11 =
   1.636 -		{ (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED};
   1.637 +        { (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED};
   1.638  
   1.639  /* Sequence of Surface test cases */
   1.640  static const SDLTest_TestCaseReference *surfaceTests[] =  {
   1.641 -	&surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5,
   1.642 -	&surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, &surfaceTest11, NULL
   1.643 +    &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5,
   1.644 +    &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, &surfaceTest11, NULL
   1.645  };
   1.646  
   1.647  /* Surface test suite (global) */
   1.648  SDLTest_TestSuiteReference surfaceTestSuite = {
   1.649 -	"Surface",
   1.650 -	_surfaceSetUp,
   1.651 -	surfaceTests,
   1.652 -	_surfaceTearDown
   1.653 +    "Surface",
   1.654 +    _surfaceSetUp,
   1.655 +    surfaceTests,
   1.656 +    _surfaceTearDown
   1.657  
   1.658  };