X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-open.c;h=37109a58a145365f6ca5f7bc1bd6d0dfd49b376b;hb=1697fcca5dcb036ef6647969cbbaad907d16479c;hp=c9f3641c3526d8f1a4af0db411654c4d27e4e7b9;hpb=fb8c836ade0d4ab8050c2c381795ce098b701115;p=gnulib.git diff --git a/tests/test-open.c b/tests/test-open.c index c9f3641c3..37109a58a 100644 --- a/tests/test-open.c +++ b/tests/test-open.c @@ -20,32 +20,30 @@ #include +#include +#include #include #include - -#if GNULIB_FCNTL_SAFER -# include "fcntl--.h" -#endif +#include #define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ + do \ + { \ + if (!(expr)) \ + { \ fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ + fflush (stderr); \ + abort (); \ + } \ + } \ while (0) -int -main () -{ - ASSERT (open ("nonexist.ent/", O_CREAT | O_RDONLY, 0600) < 0); - ASSERT (open ("/dev/null/", O_RDONLY) < 0); +#define BASE "test-open.t" - ASSERT (open ("/dev/null", O_RDONLY) >= 0); +#include "test-open.h" - return 0; +int +main (void) +{ + return test_open (open, true); }