tests: add signature checks
[gnulib.git] / tests / test-renameat.c
index 88c0cb0..3293d52 100644 (file)
@@ -20,6 +20,9 @@
 
 #include <stdio.h>
 
+#include "signature.h"
+SIGNATURE_CHECK (renameat, int, (int, char const *, int, char const *));
+
 #include <fcntl.h>
 #include <errno.h>
 #include <stdbool.h>
   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)
 
@@ -134,7 +137,8 @@ main (void)
   ASSERT (unlink (BASE "sub2/file") == 0);
   errno = 0;
   ASSERT (renameat (dfd, BASE "sub2", dfd, BASE "sub1/.") == -1);
-  ASSERT (errno == EINVAL || errno == EISDIR || errno == EBUSY);
+  ASSERT (errno == EINVAL || errno == EISDIR || errno == EBUSY
+          || errno == ENOTEMPTY);
   errno = 0;
   ASSERT (renameat (dfd, BASE "sub2/.", dfd, BASE "sub1") == -1);
   ASSERT (errno == EINVAL || errno == EBUSY);