New module attribute 'Applicability'.
[gnulib.git] / tests / test-fstatat.c
index a70721a..e965997 100644 (file)
 #include "pathmax.h"
 #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 ();                                                          \
-       }                                                                    \
+        {                                                                    \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__);  \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
     }                                                                        \
   while (0)
 
@@ -69,21 +65,21 @@ do_lstat (char const *name, struct stat *st)
 }
 
 int
-main ()
+main (void)
 {
   int result;
-  ASSERT (test_stat_func (do_stat) == 0);
-  result = test_lstat_func (do_lstat, false);
+  result = test_stat_func (do_stat, false);
+  ASSERT (test_lstat_func (do_lstat, false) == result);
   dfd = open (".", O_RDONLY);
   ASSERT (0 <= dfd);
-  ASSERT (test_stat_func (do_stat) == 0);
+  ASSERT (test_stat_func (do_stat, false) == result);
   ASSERT (test_lstat_func (do_lstat, false) == result);
   ASSERT (close (dfd) == 0);
 
   /* FIXME - add additional tests of dfd not at current directory.  */
 
   if (result == 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 result;
 }