summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2019-05-02 08:38:42 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2019-05-02 08:38:42 +0000
commit913fe1d3588f03308c5d9b082264f84b26b0e3ca (patch)
tree3cf7bf85b426aba268763d6e4a4086cfe78096a3
parentb5fe4d1932aeef80c40958de8351dc6d3f7615cb (diff)
Add test fseek(,-1) works properly.
-rw-r--r--regress/lib/libc/open_memstream/open_memstreamtest.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/regress/lib/libc/open_memstream/open_memstreamtest.c b/regress/lib/libc/open_memstream/open_memstreamtest.c
index 0608bddeba4..5366a82ae98 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.4 2014/07/20 01:58:37 guenther Exp $ */
+/* $OpenBSD: open_memstreamtest.c,v 1.5 2019/05/02 08:38:41 yasuoka Exp $ */
/*
* Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
@@ -164,13 +164,18 @@ main(void)
failures++;
}
+ if (fseek(fp, -1, SEEK_END) != 0) {
+ warnx("failed to fseek. (24)");
+ failures++;
+ }
+
if (fclose(fp) == EOF) {
- warnx("fclose failed. (24)");
+ warnx("fclose failed. (25)");
failures++;
}
if (size != 12) {
- warnx("failed, size %zu should be %u. (25)",
+ warnx("failed, size %zu should be %u. (26)",
size, 12);
failures++;
}