X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-open.c;h=37109a58a145365f6ca5f7bc1bd6d0dfd49b376b;hb=dcfa509347541cf4a44f7e5be5fc74398d8a8199;hp=f7bb54360adc58e4bd251d98ca7ecb2ff5efa7ec;hpb=b80176069521ff306b2b81ef0a9abfa8d741ada7;p=gnulib.git diff --git a/tests/test-open.c b/tests/test-open.c index f7bb54360..37109a58a 100644 --- a/tests/test-open.c +++ b/tests/test-open.c @@ -20,28 +20,30 @@ #include +#include +#include #include #include +#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); }