X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-unlinkat.c;h=7d805743842540aa4df4d4fd49471bb201a85a14;hb=800b95c20c636e1bd2e0f1c5e1ce3f84b5089942;hp=8e0a1cd7d78e1754078f1aa2e274a2dd76a92398;hpb=ff4e8f6b53d7b8c53856ba8ba2adaad3251e6a88;p=gnulib.git diff --git a/tests/test-unlinkat.c b/tests/test-unlinkat.c index 8e0a1cd7d..7d8057438 100644 --- a/tests/test-unlinkat.c +++ b/tests/test-unlinkat.c @@ -1,5 +1,5 @@ /* Tests of unlinkat. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,9 @@ #include +#include "signature.h" +SIGNATURE_CHECK (unlinkat, int, (int, char const *, int)); + #include #include #include @@ -28,22 +31,8 @@ #include #include "unlinkdir.h" - -#if !HAVE_SYMLINK -# define symlink(a,b) (-1) -#endif - -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "ignore-value.h" +#include "macros.h" #define BASE "test-unlinkat.t" @@ -67,11 +56,15 @@ unlinker (char const *name) } int -main () +main (void) { /* FIXME: Add tests of fd other than ".". */ int result1; int result2; + + /* Remove any leftovers from a previous partial run. */ + ignore_value (system ("rm -rf " BASE "*")); + result1 = test_rmdir_func (rmdirat, false); result2 = test_unlink_func (unlinker, false); ASSERT (result1 == result2); @@ -83,7 +76,7 @@ main () ASSERT (result1 == result2); ASSERT (close (dfd) == 0); if (result1 == 77) - fputs ("skipping test: symlinks not supported on this filesystem\n", - stderr); + fputs ("skipping test: symlinks not supported on this file system\n", + stderr); return result1; }