summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2019-05-13 02:54:55 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2019-05-13 02:54:55 +0000
commit5c9fa949683fb2e7f04731f0e407cb46c9a930fb (patch)
tree17f7dd47710e5edf506afaa59fa4caf2eb843de7
parent56f65a250ac4a2daca357f9cc9106e1fa3cf5aee (diff)
The call to fseek(fp, -1, SEEK_END) also sets the reported size to
this value. To match the expectation of the test again, move this line before the the code that sets the final position. OK yasuoka@
-rw-r--r--regress/lib/libc/open_memstream/open_memstreamtest.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/regress/lib/libc/open_memstream/open_memstreamtest.c b/regress/lib/libc/open_memstream/open_memstreamtest.c
index 5366a82ae98..e8da0e03b21 100644
--- a/regress/lib/libc/open_memstream/open_memstreamtest.c
+++ b/regress/lib/libc/open_memstream/open_memstreamtest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: open_memstreamtest.c,v 1.5 2019/05/02 08:38:41 yasuoka Exp $ */
+/* $OpenBSD: open_memstreamtest.c,v 1.6 2019/05/13 02:54:54 bluhm Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -138,33 +138,33 @@ main(void)
failures++;
}
- if (fseek(fp, 8, SEEK_SET) != 0) {
+ if (fseek(fp, -1, SEEK_END) != 0) {
warnx("failed to fseek. (19)");
failures++;
}
+ if (fseek(fp, 8, SEEK_SET) != 0) {
+ warnx("failed to fseek. (20)");
+ failures++;
+ }
+
if (ftell(fp) != 8) {
- warnx("failed seek test. (20)");
+ warnx("failed seek test. (21)");
failures++;
}
/* Try to seek backward */
if (fseek(fp, -1, SEEK_CUR) != 0) {
- warnx("failed to fseek. (21)");
+ warnx("failed to fseek. (22)");
failures++;
}
if (ftell(fp) != 7) {
- warnx("failed seeking backward. (22)");
+ warnx("failed seeking backward. (23)");
failures++;
}
if (fseek(fp, 5, SEEK_CUR) != 0) {
- warnx("failed to fseek. (23)");
- failures++;
- }
-
- if (fseek(fp, -1, SEEK_END) != 0) {
warnx("failed to fseek. (24)");
failures++;
}