summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/stdio/test___fseterr.c
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2025-08-02 06:16:35 +0000
committercvs2svn <admin@example.com>2025-08-02 06:16:35 +0000
commita397c95f8aea58533e72379d6e0de12683ecd0dc (patch)
tree45ccaccd0ce2ea01650f0a9f5e9268a656e17e51 /src/regress/lib/libc/stdio/test___fseterr.c
parenta79e90e7342954ae2287db505811ca3c1cd336d7 (diff)
downloadopenbsd-tb_20250802.tar.gz
openbsd-tb_20250802.tar.bz2
openbsd-tb_20250802.zip
This commit was manufactured by cvs2git to create tag 'tb_20250802'.tb_20250802
Diffstat (limited to 'src/regress/lib/libc/stdio/test___fseterr.c')
-rw-r--r--src/regress/lib/libc/stdio/test___fseterr.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/regress/lib/libc/stdio/test___fseterr.c b/src/regress/lib/libc/stdio/test___fseterr.c
deleted file mode 100644
index 70fb491c6c..0000000000
--- a/src/regress/lib/libc/stdio/test___fseterr.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/* $OpenBSD: test___fseterr.c,v 1.1 2025/05/25 00:20:54 yasuoka Exp $ */
2
3/*
4 * Copyright (c) 2025 YASUOKA Masahiko <yasuoka@yasuoka.net>
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19#include <assert.h>
20#include <stdio.h>
21#include <stdio_ext.h>
22#include <stdlib.h>
23
24/* we use assert() */
25#undef NDEBUG
26
27#define TMPFILENAME "test___fseterr.tmp"
28
29void test___fseterr0(void);
30
31void
32test___fseterr0(void)
33{
34 FILE *fp;
35 int r;
36
37 fp = fopen(TMPFILENAME, "w+");
38 assert(fp != NULL);
39
40 assert(!ferror(fp));
41
42 r = fprintf(fp, "hello world\n");
43 assert(r > 0);
44
45 __fseterr(fp);
46 assert(ferror(fp));
47
48 r = fprintf(fp, "hello world\n");
49 assert(r == -1);
50
51 fclose(fp);
52}
53
54int
55main(int argc, char *argv[])
56{
57 test___fseterr0();
58
59 exit(0);
60}