test: patched to compile.

This commit is contained in:
Ryan C. Gordon 2022-12-14 23:24:56 -05:00
parent 980208b814
commit 83559503c4
No known key found for this signature in database
GPG Key ID: FA148B892AB48044

View File

@ -139,19 +139,19 @@ int main(int argc, char *argv[])
if (rwops == NULL) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (10 != rwops->write(rwops, "1234567890", 1, 10)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->write(rwops, "1234567", 1, 7)) {
if (7 != rwops->write(rwops, "1234567", 7)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 1, 1)) {
if (0 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops); /* we are in write only mode */
}
@ -167,28 +167,28 @@ int main(int argc, char *argv[])
if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->read(rwops, test_buf, 1, 7)) {
if (7 != rwops->read(rwops, test_buf, 7)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "1234567", 7) != 0) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 1, 1)) {
if (0 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 10, 100)) {
if (0 != rwops->read(rwops, test_buf, 1000)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) {
RWOP_ERR_QUIT(rwops);
}
if (2 != rwops->read(rwops, test_buf, 10, 3)) {
if (2 != 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, 1)) {
if (0 != rwops->write(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops); /* readonly mode */
}
@ -199,19 +199,19 @@ int main(int argc, char *argv[])
if (rwops == NULL) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (10 != rwops->write(rwops, "1234567890", 1, 10)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->write(rwops, "1234567", 1, 7)) {
if (7 != rwops->write(rwops, "1234567", 7)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->read(rwops, test_buf, 1, 1)) {
if (1 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops); /* we are in read/write mode */
}
@ -221,22 +221,22 @@ int main(int argc, char *argv[])
if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->read(rwops, test_buf, 1, 7)) {
if (7 != rwops->read(rwops, test_buf, 7)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "1234567", 7) != 0) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 1, 1)) {
if (0 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 10, 100)) {
if (0 != rwops->read(rwops, test_buf, 1000)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) {
RWOP_ERR_QUIT(rwops);
}
if (2 != rwops->read(rwops, test_buf, 10, 3)) {
if (2 != rwops->read(rwops, test_buf, 30)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) {
@ -250,19 +250,19 @@ int main(int argc, char *argv[])
if (rwops == NULL) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (10 != rwops->write(rwops, "1234567890", 1, 10)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->write(rwops, "1234567", 1, 7)) {
if (7 != rwops->write(rwops, "1234567", 7)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->read(rwops, test_buf, 1, 1)) {
if (1 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops); /* we are in read/write mode */
}
@ -272,22 +272,22 @@ int main(int argc, char *argv[])
if (20 != rwops->seek(rwops, -7, RW_SEEK_END)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->read(rwops, test_buf, 1, 7)) {
if (7 != rwops->read(rwops, test_buf, 7)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "1234567", 7) != 0) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 1, 1)) {
if (0 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 10, 100)) {
if (0 != rwops->read(rwops, test_buf, 1000)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, -27, RW_SEEK_CUR)) {
RWOP_ERR_QUIT(rwops);
}
if (2 != rwops->read(rwops, test_buf, 10, 3)) {
if (2 != rwops->read(rwops, test_buf, 30)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "12345678901234567890", 20) != 0) {
@ -301,20 +301,20 @@ int main(int argc, char *argv[])
if (rwops == NULL) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (10 != rwops->write(rwops, "1234567890", 1, 10)) {
if (10 != rwops->write(rwops, "1234567890", 10)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->write(rwops, "1234567", 1, 7)) {
if (7 != rwops->write(rwops, "1234567", 7)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->read(rwops, test_buf, 1, 1)) {
if (1 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
@ -324,16 +324,16 @@ int main(int argc, char *argv[])
if (20 + 27 != rwops->seek(rwops, -7, RW_SEEK_END)) {
RWOP_ERR_QUIT(rwops);
}
if (7 != rwops->read(rwops, test_buf, 1, 7)) {
if (7 != rwops->read(rwops, test_buf, 7)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "1234567", 7) != 0) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 1, 1)) {
if (0 != rwops->read(rwops, test_buf, 1)) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->read(rwops, test_buf, 10, 100)) {
if (0 != rwops->read(rwops, test_buf, 1000)) {
RWOP_ERR_QUIT(rwops);
}
@ -344,7 +344,7 @@ int main(int argc, char *argv[])
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
RWOP_ERR_QUIT(rwops);
}
if (3 != rwops->read(rwops, test_buf, 10, 3)) {
if (3 != rwops->read(rwops, test_buf, 30)) {
RWOP_ERR_QUIT(rwops);
}
if (SDL_memcmp(test_buf, "123456789012345678901234567123", 30) != 0) {