libstdc++: Fix FS-dependent filesystem tests
authorJonathan Wakely <jwakely@redhat.com>
Thu, 27 Feb 2020 16:38:00 +0000 (16:38 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 28 Feb 2020 12:58:28 +0000 (12:58 +0000)
commita51a546c1704cd572c35c11e539568c04d99e7d1
tree1ebf8ff9f963c803e435c0b6edeee4f51150906f
parent86e2dc22c91a722d2624c0010d81f1ce4b911bbd
libstdc++: Fix FS-dependent filesystem tests

These tests were failing on XFS because it doesn't support setting file
timestamps past 2038, so the expected overflow when reading back a huge
timestamp into a file_time_type didn't happen.

Additionally, the std::filesystem::file_time_type::clock has an
epoch that is out of range of 32-bit time_t so testing times around that
epoch may also fail.

This fixes the tests to give up gracefully if the filesystem doesn't
support times that can't be represented in 32-bit time_t.

* testsuite/27_io/filesystem/operations/last_write_time.cc: Fixes for
filesystems that silently truncate timestamps.
* testsuite/experimental/filesystem/operations/last_write_time.cc:
Likewise.
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/last_write_time.cc