X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=tests%2Ftest-lstat.c;h=b8f9237e5b5b807342c9d23e857ac6479c7522b7;hb=6f730e7ae5225bf9eb36554d94805b97a72784bd;hp=cb9963d3b5b9919b27e1f4b34149f03b04189bf8;hpb=3a5041b1c62c2b7c829f47bec2f1789c59844b6c;p=gnulib.git diff --git a/tests/test-lstat.c b/tests/test-lstat.c index cb9963d3b..b8f9237e5 100644 --- a/tests/test-lstat.c +++ b/tests/test-lstat.c @@ -1,5 +1,5 @@ /* Test of lstat() function. - Copyright (C) 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2008, 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,13 @@ #include +/* Caution: lstat may be a function-like macro. Although this + signature check must pass, it may be the signature of the real (and + broken) lstat rather than rpl_lstat. Most code should not use the + address of lstat. */ +#include "signature.h" +SIGNATURE_CHECK (lstat, int, (char const *, struct stat *)); + #include #include #include @@ -28,22 +35,8 @@ #include #include "same-inode.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-lstat.t" @@ -58,7 +51,10 @@ do_lstat (char const *name, struct stat *st) } int -main () +main (void) { + /* Remove any leftovers from a previous partial run. */ + ignore_value (system ("rm -rf " BASE "*")); + return test_lstat_func (do_lstat, true); }