test/testautomation_rwops.c
changeset 6996 bc0fd5bced25
parent 6821 f36771112651
child 6999 681820ca0e78
     1.1 --- a/test/testautomation_rwops.c	Sun Mar 10 21:10:10 2013 -0700
     1.2 +++ b/test/testautomation_rwops.c	Tue Mar 12 09:10:37 2013 -0700
     1.3 @@ -78,6 +78,7 @@
     1.4  {
     1.5     char buf[sizeof(RWopsHelloWorldTestString)];
     1.6     Sint64 i;
     1.7 +   size_t s;
     1.8     int seekPos = SDLTest_RandomIntegerInRange(4, 8);
     1.9  
    1.10     /* Clear buffer */
    1.11 @@ -89,13 +90,13 @@
    1.12     SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
    1.13  
    1.14     /* Test write. */
    1.15 -   i = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1);
    1.16 +   s = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1);
    1.17     SDLTest_AssertPass("Call to SDL_RWwrite succeeded");
    1.18     if (write) {
    1.19 -		SDLTest_AssertCheck(i == (Sint64)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", i);
    1.20 +		SDLTest_AssertCheck(s == (size_t)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", s);
    1.21     }
    1.22     else {
    1.23 -		SDLTest_AssertCheck(i != (Sint64)1, "Verify result of writing with SDL_RWwrite, expected !=1, got %i", i);
    1.24 +		SDLTest_AssertCheck(s == (size_t)0, "Verify result of writing with SDL_RWwrite, expected: 0, got %i", s);
    1.25     }
    1.26  
    1.27     /* Test seek to random position */
    1.28 @@ -109,13 +110,13 @@
    1.29     SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
    1.30  
    1.31     /* Test read */
    1.32 -   i = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 );
    1.33 +   s = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 );
    1.34     SDLTest_AssertPass("Call to SDL_RWread succeeded");
    1.35     SDLTest_AssertCheck(
    1.36 -	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-1), 
    1.37 +	   s == (size_t)(sizeof(RWopsHelloWorldTestString)-1), 
    1.38  	   "Verify result from SDL_RWread, expected %i, got %i",
    1.39  	   sizeof(RWopsHelloWorldTestString)-1,
    1.40 -	   i);
    1.41 +	   s);
    1.42     SDLTest_AssertCheck(
    1.43  	   SDL_memcmp(buf, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1 ) == 0, 
    1.44  	   "Verify read bytes match expected string, expected '%s', got '%s'", RWopsHelloWorldTestString, buf);