test-pwrite: do not leave behind a test file named "out"
[gnulib.git] / tests / test-symlinkat.c
index 67f0adf..c3dec29 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of symlinkat and readlinkat.
-   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
@@ -32,22 +32,13 @@ SIGNATURE_CHECK (readlinkat, ssize_t, (int, char const *, char *, size_t));
 #include <string.h>
 #include <sys/stat.h>
 
+#include "ignore-value.h"
+#include "macros.h"
+
 #ifndef HAVE_SYMLINK
 # define HAVE_SYMLINK 0
 #endif
 
-#define ASSERT(expr) \
-  do                                                                         \
-    {                                                                        \
-      if (!(expr))                                                           \
-        {                                                                    \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__);  \
-          fflush (stderr);                                                   \
-          abort ();                                                          \
-        }                                                                    \
-    }                                                                        \
-  while (0)
-
 #define BASE "test-symlinkat.t"
 
 #include "test-readlink.h"
@@ -74,7 +65,7 @@ main (void)
   int result;
 
   /* Remove any leftovers from a previous partial run.  */
-  ASSERT (system ("rm -rf " BASE "*") == 0);
+  ignore_value (system ("rm -rf " BASE "*"));
 
   /* Perform same checks as counterpart functions.  */
   result = test_readlink (do_readlink, false);