diff options
| author | guenther <> | 2013-04-03 03:11:53 +0000 |
|---|---|---|
| committer | guenther <> | 2013-04-03 03:11:53 +0000 |
| commit | 14b45af899b92c226bef4713734f997d10d72354 (patch) | |
| tree | 894df00beef4fa8b72c5631728901f6dd9b9ed95 | |
| parent | cbaf45a7b947271ba7389d6904f2233e1d5e89e8 (diff) | |
| download | openbsd-14b45af899b92c226bef4713734f997d10d72354.tar.gz openbsd-14b45af899b92c226bef4713734f997d10d72354.tar.bz2 openbsd-14b45af899b92c226bef4713734f997d10d72354.zip | |
Set the stream orientation in open_{,w}memstream().
Check it in the regress test
ok mpi@
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libc/orientation/orientation_test.c | 16 |
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); |
