X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-lstat.c;h=459bf88793bf18e7dace05f9b6340a48f743d806;hb=25b6b5120113989e0b91de9d0b75d3d625bbc753;hp=89edb1fa02b7f96d0f8eb7ea95fe0c6fad1ce881;hpb=7eba2f98240cd9a9c0cc81b4ebb7103bbe8630a7;p=gnulib.git diff --git a/tests/test-lstat.c b/tests/test-lstat.c index 89edb1fa0..459bf8879 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-2012 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,18 +35,8 @@ #include #include "same-inode.h" - -#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" @@ -54,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); }