diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-07-23 11:14:57 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-05 16:41:38 +0000 |
commit | 6c3a3d498a8797c481a394418fff8f7bf1886c61 (patch) | |
tree | b64407f2b2520d46b42f96495c41600aaae03d3c /tests/auto/corelib/io/qfilesystemmetadata | |
parent | db433bdf65e011e64be51948e79abc02034dddbf (diff) |
Filesystem: Use "birth time" to avoid confusion with Unix ctime
The Unix stat fields "st_ctime" and "st_ctim" mean "change time", the
last time that the file/inode status fields were changed. It does not
mean "creation time". So this commit splits all of the internal API to
"birth" and "metadata change" instead of "creation" to avoid the
conflict.
Change-Id: I149e0540c00745fe8119fffd1463fe78b619649e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qfilesystemmetadata')
-rw-r--r-- | tests/auto/corelib/io/qfilesystemmetadata/tst_qfilesystemmetadata.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qfilesystemmetadata/tst_qfilesystemmetadata.cpp b/tests/auto/corelib/io/qfilesystemmetadata/tst_qfilesystemmetadata.cpp index 1c104688a5..ea4da39cd5 100644 --- a/tests/auto/corelib/io/qfilesystemmetadata/tst_qfilesystemmetadata.cpp +++ b/tests/auto/corelib/io/qfilesystemmetadata/tst_qfilesystemmetadata.cpp @@ -66,14 +66,16 @@ void tst_QFileSystemMetaData::timeSinceEpoch() /* data.ftLastAccessTime = data.ftLastWriteTime = */ data.ftCreationTime = epochToFileTime(afterEpochUtc); meta.fillFromFindData(data); + QCOMPARE(meta.birthTime().toUTC(), + QDateTime::fromMSecsSinceEpoch(afterEpochUtc * qint64(1000), Qt::UTC)); #else QT_STATBUF data; memset(&data, 0, sizeof(data)); data.st_ctime = afterEpochUtc; meta.fillFromStatBuf(data); -#endif - QCOMPARE(meta.creationTime().toUTC(), + QCOMPARE(meta.metadataChangeTime().toUTC(), QDateTime::fromMSecsSinceEpoch(afterEpochUtc * qint64(1000), Qt::UTC)); +#endif } #else // i.e. no Q_AUTOTEST_EXPORT void tst_QFileSystemMetaData::timeSinceEpoch() |