+2021-01-02 Bruno Haible <bruno@clisp.org>
+
+ utimens: Avoid test failures on macOS 10.13.
+ Reported by Martin Storsjö <martin@martin.st> in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00003.html>.
+ * tests/test-utimens-common.h (check_ctime): Define to -1 on macOS.
+ * tests/test-utimens.h (test_utimens): Don't expect a ctime change when
+ only the atime is requested to change.
+ * tests/test-futimens.h (test_futimens): Likewise.
+ * tests/test-lutimens.h (test_lutimens): Likewise.
+
2021-01-02 Bruno Haible <bruno@clisp.org>
renameatu: Fix test failures on macOS.
ASSERT (get_stat_atime_ns (&st2) == 0);
ASSERT (st3.st_mtime == st2.st_mtime);
ASSERT (get_stat_mtime_ns (&st3) == get_stat_mtime_ns (&st2));
- if (check_ctime)
+ if (check_ctime > 0)
ASSERT (ctime_compare (&st3, &st2) < 0);
}
}
ASSERT (st3.st_mtime == st2.st_mtime);
ASSERT (get_stat_mtime_ns (&st3) == get_stat_mtime_ns (&st2));
- if (check_ctime)
+ if (check_ctime > 0)
ASSERT (ctime_compare (&st3, &st2) < 0);
}
properly tracked change time. See
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions>. */
# define check_ctime 0
+# elif defined __APPLE__ && defined __MACH__
+/* On macOS, the ctime is not updated when only the st_atime changes. */
+# define check_ctime -1
# else
# define check_ctime 1
# endif
ASSERT (get_stat_atime_ns (&st2) == 0);
ASSERT (st3.st_mtime == st2.st_mtime);
ASSERT (get_stat_mtime_ns (&st3) == get_stat_mtime_ns (&st2));
- if (check_ctime)
+ if (check_ctime > 0)
ASSERT (ctime_compare (&st3, &st2) < 0);
}