sys_stat: guarantee struct timespec
[gnulib.git] / tests / test-utimens.c
index 5734a57..e43663a 100644 (file)
@@ -39,6 +39,7 @@
 #define BASE "test-utimens.t"
 
 #include "test-futimens.h"
+#include "test-lutimens.h"
 #include "test-utimens.h"
 
 /* Wrap gl_futimens to behave like futimens.  */
@@ -57,7 +58,7 @@ do_fdutimens (char const *name, struct timespec const times[2])
   if (fd < 0)
     fd = open (name, O_RDONLY);
   errno = 0;
-  result = gl_futimens (fd, name, times);
+  result = fdutimens (name, fd, times);
   if (0 <= fd)
     {
       int saved_errno = errno;
@@ -70,10 +71,20 @@ do_fdutimens (char const *name, struct timespec const times[2])
 int
 main ()
 {
+  int result1;
+  int result2;
+
   /* Clean up any trash from prior testsuite runs.  */
   ASSERT (system ("rm -rf " BASE "*") == 0);
 
   ASSERT (test_utimens (utimens) == 0);
   ASSERT (test_utimens (do_fdutimens) == 0);
-  return test_futimens (do_futimens, true);
+  result1 = test_futimens (do_futimens, true);
+  if (result1)
+    ASSERT (result1 == 77);
+  /* Print only one skip message.  */
+  result2 = test_lutimens (lutimens, result1 == 0);
+  if (result2)
+    ASSERT (result2 == 77);
+  return result1 | result2;
 }