7 static void do_prepare (void);
8 #define PREPARE(argc, argv) do_prepare ()
9 static int do_test (void);
10 #define TEST_FUNCTION do_test ()
11 #include <test-skeleton.c>
20 fd
= create_temp_file ("tst-eof.", NULL
);
23 printf ("cannot create temporary file: %m\n");
35 if (write (fd
, "some string\n", 12) != 12)
37 printf ("cannot write temporary file: %m\n");
41 if (lseek (fd
, 0, SEEK_SET
) == (off_t
) -1)
43 printf ("cannot reposition temporary file: %m\n");
47 fp
= fdopen (fd
, "r");
50 printf ("cannot create stream: %m\n");
56 puts ("EOF set after fdopen");
60 if (fread (buf
, 1, 20, fp
) != 12)
62 puts ("didn't read the correct number of bytes");
68 puts ("EOF not set after fread");