X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-canonicalize.c;h=a095e0e882c86d12bcfba0cd8791d8644b4c63a2;hb=17f0ec6;hp=749cc1eec1c0361b802e214adea3fff21c380f8a;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/tests/test-canonicalize.c b/tests/test-canonicalize.c index 749cc1eec..a095e0e88 100644 --- a/tests/test-canonicalize.c +++ b/tests/test-canonicalize.c @@ -1,5 +1,5 @@ /* Test of execution of file name canonicalization. - Copyright (C) 2007-2009 Free Software Foundation, Inc. + Copyright (C) 2007-2011 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 @@ -29,21 +29,17 @@ #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 "t-can.tmp" +static void * +null_ptr (void) +{ + return NULL; +} + int main (void) { @@ -51,7 +47,7 @@ main (void) any leftovers from a previous partial run. */ { int fd; - ASSERT (system ("rm -rf " BASE " ise") == 0); + ignore_value (system ("rm -rf " BASE " ise")); ASSERT (mkdir (BASE, 0700) == 0); fd = creat (BASE "/tra", 0600); ASSERT (0 <= fd); @@ -79,7 +75,7 @@ main (void) ASSERT (result2 == NULL); ASSERT (errno == ENOENT); errno = 0; - result1 = canonicalize_file_name (NULL); + result1 = canonicalize_file_name (null_ptr ()); ASSERT (result1 == NULL); ASSERT (errno == EINVAL); errno = 0;