1 | #include <stdio.h> |
---|---|
2 | #include <errno.h> |
3 | |
4 | static int |
5 | do_test (void) |
6 | { |
7 | FILE *fp = fopen ("/foobar_does_no_exit", "re"); |
8 | if (fp != NULL) |
9 | { |
10 | /* A joker created this file. Ignore the test. */ |
11 | fclose (fp); |
12 | return 0; |
13 | } |
14 | |
15 | if (errno == ENOENT) |
16 | { |
17 | printf (format: "no bug\n"); |
18 | return 0; |
19 | } |
20 | |
21 | printf (format: "bug : expected ENOENT, got: %m\n"); |
22 | return 1; |
23 | } |
24 | |
25 | #define TEST_FUNCTION do_test () |
26 | #include "../test-skeleton.c" |
27 |