From 1f6a37d63e33545d9bb886421a8bda2b14b99db7 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 11 Aug 2016 16:58:12 +0000 Subject: [PATCH] test: relax the FS test a slight bit to be more reliable Some filesystems track atime always. This relaxes the test to accept either a filesystem which does not accurately track atime or does track the atime accurately. This allows the test to pass on filesystems mounted with `strictatime` on Linux or on macOS. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278357 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp b/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp index 3c61b26d1..50407b039 100644 --- a/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp +++ b/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp @@ -158,7 +158,8 @@ TEST_CASE(get_last_write_time_dynamic_env_test) TEST_CHECK(ftime2 > ftime); TEST_CHECK(dtime2 > dtime); - TEST_CHECK(LastAccessTime(file) == file_access_time); + TEST_CHECK(LastAccessTime(file) == file_access_time || + LastAccessTime(file) == Clock::to_time_t(ftime2)); TEST_CHECK(LastAccessTime(dir) == dir_access_time); }