SDL: testfile: fix reference values

From 75da730a882ec5e1559e4fd8ec38a4b93c9d7b09 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Fri, 17 Mar 2023 03:50:08 +0100
Subject: [PATCH] testfile: fix reference values

---
 test/testfile.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/testfile.c b/test/testfile.c
index 3209ff829920..cc95713757f1 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) {