testfile: fix reference values

This commit is contained in:
Anonymous Maarten 2023-03-17 03:50:08 +01:00 committed by Anonymous Maarten
parent ee13b74d59
commit 75da730a88
1 changed files with 7 additions and 7 deletions

View File

@ -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) {