summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorguenther <>2013-04-03 03:11:53 +0000
committerguenther <>2013-04-03 03:11:53 +0000
commit0b4c0e6db7e6b4d56eaab7c0207dc28b51902a82 (patch)
tree894df00beef4fa8b72c5631728901f6dd9b9ed95 /src
parent2db185b73a6b70d60eca720c972352ea7dedfa14 (diff)
downloadopenbsd-0b4c0e6db7e6b4d56eaab7c0207dc28b51902a82.tar.gz
openbsd-0b4c0e6db7e6b4d56eaab7c0207dc28b51902a82.tar.bz2
openbsd-0b4c0e6db7e6b4d56eaab7c0207dc28b51902a82.zip
Set the stream orientation in open_{,w}memstream().
Check it in the regress test ok mpi@
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libc/orientation/orientation_test.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/regress/lib/libc/orientation/orientation_test.c b/src/regress/lib/libc/orientation/orientation_test.c
index 1d0911d12f..2d8fb4fd20 100644
--- a/src/regress/lib/libc/orientation/orientation_test.c
+++ b/src/regress/lib/libc/orientation/orientation_test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: orientation_test.c,v 1.3 2011/10/16 14:39:01 stsp Exp $ */ 1/* $OpenBSD: orientation_test.c,v 1.4 2013/04/03 03:11:53 guenther Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009 Philip Guenther 4 * Copyright (c) 2009 Philip Guenther
@@ -111,6 +111,8 @@ main(int argc, char *argv[])
111{ 111{
112 char buffer[BUFSIZ]; 112 char buffer[BUFSIZ];
113 wchar_t wbuffer[BUFSIZ]; 113 wchar_t wbuffer[BUFSIZ];
114 char *buf;
115 wchar_t *wbuf;
114 FILE *f; 116 FILE *f;
115 off_t off; 117 off_t off;
116 fpos_t pos; 118 fpos_t pos;
@@ -241,6 +243,18 @@ main(int argc, char *argv[])
241 TEST_WIDE_STD(stdout, wprintf(L"foo")); 243 TEST_WIDE_STD(stdout, wprintf(L"foo"));
242 244
243 245
246 /* memory streams */
247 f = open_memstream(&buf, &size);
248 if (!((r = fwide(f, 0)) < 0))
249 fail(__LINE__, r, "<", "open_memstream()");
250 fclose(f);
251 f = open_wmemstream(&wbuf, &size);
252 if (!((r = fwide(f, 0)) > 0))
253 fail(__LINE__, r, ">", "open_wmemstream()");
254 fclose(f);
255
256
257 /* random stuff? */
244 TEST_UNCHANGED_STD(stderr, perror("foo")); 258 TEST_UNCHANGED_STD(stderr, perror("foo"));
245 259
246 remove(filename); 260 remove(filename);