summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/open_memstream
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libc/open_memstream')
-rw-r--r--src/regress/lib/libc/open_memstream/open_memstreamtest.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/regress/lib/libc/open_memstream/open_memstreamtest.c b/src/regress/lib/libc/open_memstream/open_memstreamtest.c
index b9c0221b1a..a2327f21c5 100644
--- a/src/regress/lib/libc/open_memstream/open_memstreamtest.c
+++ b/src/regress/lib/libc/open_memstream/open_memstreamtest.c
@@ -1,4 +1,5 @@
1/* $OpenBSD: open_memstreamtest.c,v 1.2 2013/03/25 03:33:28 guenther Exp $ */ 1/* $OpenBSD: open_memstreamtest.c,v 1.3 2013/03/28 09:35:58 mpi Exp $ */
2
2/* 3/*
3 * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org> 4 * Copyright (c) 2011 Martin Pieuchot <mpi@openbsd.org>
4 * 5 *
@@ -137,6 +138,27 @@ main(void)
137 failures++; 138 failures++;
138 } 139 }
139 140
141 if (fseek(fp, 8, SEEK_SET) != 0) {
142 warnx("failed to fseek. (19)");
143 failures++;
144 }
145
146 if (ftell(fp) != 8) {
147 warnx("failed seek test. (20)");
148 failures++;
149 }
150
151 /* Try to seek backward */
152 if (fseek(fp, -1, SEEK_CUR) != 0) {
153 warnx("failed to fseek. (21)");
154 failures++;
155 }
156
157 if (ftell(fp) != 7) {
158 warnx("failed seeking backward. (22)");
159 failures++;
160 }
161
140 free(buf); 162 free(buf);
141 163
142 return (failures); 164 return (failures);