test/testautomation_rwops.c
changeset 6779 c3b579c78059
parent 6769 b49778d885cd
child 6781 17a9b53a5ac3
     1.1 --- a/test/testautomation_rwops.c	Sun Dec 30 09:58:03 2012 -0800
     1.2 +++ b/test/testautomation_rwops.c	Sun Dec 30 10:58:18 2012 -0800
     1.3 @@ -76,7 +76,7 @@
     1.4  _testGenericRWopsValidations(SDL_RWops *rw, int write)
     1.5  {
     1.6     char buf[sizeof(RWopsHelloWorldTestString)];
     1.7 -   int i;
     1.8 +   Sint64 i;
     1.9     int seekPos = SDLTest_RandomIntegerInRange(4, 8);
    1.10  
    1.11     /* Clear buffer */
    1.12 @@ -85,33 +85,33 @@
    1.13     /* Set to start. */
    1.14     i = SDL_RWseek(rw, 0, RW_SEEK_SET );
    1.15     SDLTest_AssertPass("Call to SDL_RWseek succeeded");
    1.16 -   SDLTest_AssertCheck(i == 0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
    1.17 +   SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
    1.18  
    1.19     /* Test write. */
    1.20     i = SDL_RWwrite(rw, RWopsHelloWorldTestString, sizeof(RWopsHelloWorldTestString)-1, 1);
    1.21     SDLTest_AssertPass("Call to SDL_RWwrite succeeded");
    1.22     if (write) {
    1.23 -		SDLTest_AssertCheck(i == 1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", i);
    1.24 +		SDLTest_AssertCheck(i == (Sint64)1, "Verify result of writing one byte with SDL_RWwrite, expected 1, got %i", i);
    1.25     }
    1.26     else {
    1.27 -		SDLTest_AssertCheck(i <= 0, "Verify result of writing with SDL_RWwrite, expected <=0, got %i", i);
    1.28 +		SDLTest_AssertCheck(i != (Sint64)1, "Verify result of writing with SDL_RWwrite, expected !=1, got %i", i);
    1.29     }
    1.30  
    1.31     /* Test seek to random position */
    1.32     i = SDL_RWseek( rw, seekPos, RW_SEEK_SET );
    1.33     SDLTest_AssertPass("Call to SDL_RWseek succeeded");
    1.34 -   SDLTest_AssertCheck(i == seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %i", seekPos, seekPos, i);
    1.35 +   SDLTest_AssertCheck(i == (Sint64)seekPos, "Verify seek to %i with SDL_RWseek (RW_SEEK_SET), expected %i, got %i", seekPos, seekPos, i);
    1.36  
    1.37     /* Test seek back to start */
    1.38     i = SDL_RWseek(rw, 0, RW_SEEK_SET );
    1.39     SDLTest_AssertPass("Call to SDL_RWseek succeeded");
    1.40 -   SDLTest_AssertCheck(i == 0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
    1.41 +   SDLTest_AssertCheck(i == (Sint64)0, "Verify seek to 0 with SDL_RWseek (RW_SEEK_SET), expected 0, got %i", i);
    1.42  
    1.43     /* Test read */
    1.44     i = SDL_RWread( rw, buf, 1, sizeof(RWopsHelloWorldTestString)-1 );
    1.45     SDLTest_AssertPass("Call to SDL_RWread succeeded");
    1.46     SDLTest_AssertCheck(
    1.47 -	   i == (sizeof(RWopsHelloWorldTestString)-1), 
    1.48 +	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-1), 
    1.49  	   "Verify result from SDL_RWread, expected %i, got %i",
    1.50  	   sizeof(RWopsHelloWorldTestString)-1,
    1.51  	   i);
    1.52 @@ -123,7 +123,7 @@
    1.53     i = SDL_RWseek( rw, -4, RW_SEEK_CUR );
    1.54     SDLTest_AssertPass("Call to SDL_RWseek(...,-4,RW_SEEK_CUR) succeeded");
    1.55     SDLTest_AssertCheck(
    1.56 -	   i == (sizeof(RWopsHelloWorldTestString)-5), 
    1.57 +	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-5), 
    1.58  	   "Verify seek to -4 with SDL_RWseek (RW_SEEK_CUR), expected %i, got %i",
    1.59  	   sizeof(RWopsHelloWorldTestString)-5,
    1.60  	   i);
    1.61 @@ -131,7 +131,7 @@
    1.62     i = SDL_RWseek( rw, -1, RW_SEEK_END );
    1.63     SDLTest_AssertPass("Call to SDL_RWseek(...,-1,RW_SEEK_END) succeeded");
    1.64     SDLTest_AssertCheck(
    1.65 -	   i == (sizeof(RWopsHelloWorldTestString)-2), 
    1.66 +	   i == (Sint64)(sizeof(RWopsHelloWorldTestString)-2), 
    1.67  	   "Verify seek to -1 with SDL_RWseek (RW_SEEK_END), expected %i, got %i",
    1.68  	   sizeof(RWopsHelloWorldTestString)-2,
    1.69  	   i);
    1.70 @@ -326,7 +326,7 @@
    1.71     if (fp == NULL) return TEST_ABORTED;
    1.72  
    1.73     /* Open */
    1.74 -   rw = SDL_RWFromFP( fp, 1 );
    1.75 +   rw = SDL_RWFromFP( fp, SDL_TRUE );
    1.76     SDLTest_AssertPass("Call to SDL_RWFromFP() succeeded");
    1.77     SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFP in read mode does not return NULL");
    1.78  
    1.79 @@ -369,7 +369,7 @@
    1.80     if (fp == NULL) return TEST_ABORTED;
    1.81  
    1.82     /* Open */
    1.83 -   rw = SDL_RWFromFP( fp, 1 );
    1.84 +   rw = SDL_RWFromFP( fp, SDL_TRUE );
    1.85     SDLTest_AssertPass("Call to SDL_RWFromFP() succeeded");
    1.86     SDLTest_AssertCheck(rw != NULL, "Verify opening file with SDL_RWFromFP in write mode does not return NULL");
    1.87