11 t_error("%s failed (errno = %d)\n", #c, errno); \
16 char tmp[] = "/tmp/testsuite-XXXXXX";
21 TEST((fd = mkstemp(tmp)) > 2);
22 TEST(write(fd, "hello", 6)==6);
23 TEST(f = fdopen(fd, "rb"));
26 TEST(fseeko(f, 0, SEEK_SET)==0);
27 TEST(fgets(foo, sizeof foo, f));
28 if (strcmp(foo,"hello") != 0)
29 t_error("fgets read back: \"%s\"; wanted: \"hello\"\n", foo);
33 TEST(unlink(tmp) != -1);