diff --git a/test/testfile.c b/test/testfile.c index 3209ff8299..cc95713757 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -152,13 +152,13 @@ int main(int argc, char *argv[]) if (0 != rwops->seek(rwops, 0L, SDL_RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); } - if (0 != rwops->read(rwops, test_buf, 1)) { + if (-1 != rwops->read(rwops, test_buf, 1)) { RWOP_ERR_QUIT(rwops); /* we are in write only mode */ } rwops->close(rwops); - rwops = SDL_RWFromFile(FBASENAME1, "rb"); /* read mode, file must exists */ + rwops = SDL_RWFromFile(FBASENAME1, "rb"); /* read mode, file must exist */ if (rwops == NULL) { RWOP_ERR_QUIT(rwops); } @@ -183,13 +183,13 @@ int main(int argc, char *argv[]) if (0 != rwops->seek(rwops, -27, SDL_RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); } - if (2 != rwops->read(rwops, test_buf, 30)) { + if (27 != rwops->read(rwops, test_buf, 30)) { RWOP_ERR_QUIT(rwops); } if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) { RWOP_ERR_QUIT(rwops); } - if (0 != rwops->write(rwops, test_buf, 1)) { + if (-1 != rwops->write(rwops, test_buf, 1)) { RWOP_ERR_QUIT(rwops); /* readonly mode */ } @@ -237,7 +237,7 @@ int main(int argc, char *argv[]) if (0 != rwops->seek(rwops, -27, SDL_RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); } - if (2 != rwops->read(rwops, test_buf, 30)) { + if (27 != rwops->read(rwops, test_buf, 30)) { RWOP_ERR_QUIT(rwops); } if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) { @@ -288,7 +288,7 @@ int main(int argc, char *argv[]) if (0 != rwops->seek(rwops, -27, SDL_RW_SEEK_CUR)) { RWOP_ERR_QUIT(rwops); } - if (2 != rwops->read(rwops, test_buf, 30)) { + if (27 != rwops->read(rwops, test_buf, 30)) { RWOP_ERR_QUIT(rwops); } if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) { @@ -345,7 +345,7 @@ int main(int argc, char *argv[]) if (0 != rwops->seek(rwops, 0L, SDL_RW_SEEK_SET)) { RWOP_ERR_QUIT(rwops); } - if (3 != rwops->read(rwops, test_buf, 30)) { + if (30 != rwops->read(rwops, test_buf, 30)) { RWOP_ERR_QUIT(rwops); } if (SDL_memcmp(test_buf, "123456789012345678901234567123", 30) != 0) {