7 #define PREPARE(argc, argv) \
9 int fd = create_temp_file ("tst-ext2", &fname); \
12 puts ("cannot create temporary file"); \
26 fp = fopen (fname, "w");
27 printf ("Initial state for write-only stream: %d %d\n",
28 __freading (fp) != 0, __fwriting (fp) != 0);
29 res |= ((__freading (fp) != 0) != 0
30 || (__fwriting (fp) != 0) != 1);
33 fp = fopen (fname, "r");
34 printf ("Initial state for read-only stream: %d %d\n",
35 __freading (fp) != 0, __fwriting (fp) != 0);
36 res |= ((__freading (fp) != 0) != 1
37 || (__fwriting (fp) != 0) != 0);
40 fp = fopen (fname, "r+");
41 printf ("Initial state for read-write stream: %d %d\n",
42 __freading (fp) != 0, __fwriting (fp) != 0);
43 res |= ((__freading (fp) != 0) != 0
44 || (__fwriting (fp) != 0) != 0);
47 fp = fopen (fname, "w+");
48 printf ("Initial state for read-write stream: %d %d\n",
49 __freading (fp) != 0, __fwriting (fp) != 0);
50 res |= ((__freading (fp) != 0) != 0
51 || (__fwriting (fp) != 0) != 0);
57 #define TEST_FUNCTION do_test ()
58 #include "../test-skeleton.c"