diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-01-04 16:29:39 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-01-06 17:57:52 +0000 |
commit | 26b5325767a4084ca51f485b99ac58477246e062 (patch) | |
tree | 2edcc69a6f87f9f12d33b6887b58029cc344aa43 /tests/auto | |
parent | 905bc6293354a0d3ee832b6dd3f632a647f809f3 (diff) | |
download | qtbase-26b5325767a4084ca51f485b99ac58477246e062.tar.gz |
QFileInfo: use currentDateTimeUtc()
Instead of the more verbose currentDateTime(QTZ::UTC).
Pick-to: 6.5
Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 8 | ||||
-rw-r--r-- | tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 8ddbe75809..485d5792ac 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -1130,7 +1130,7 @@ void tst_QFileInfo::fileTimes() QDateTime birthTime, writeTime, metadataChangeTime, readTime; // --- Create file and write to it - beforeBirth = QDateTime::currentDateTime(QTimeZone::UTC).addMSecs(-fsClockSkew); + beforeBirth = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew); { QFile file(fileName); QVERIFY(file.open(QFile::WriteOnly | QFile::Text)); @@ -1140,7 +1140,7 @@ void tst_QFileInfo::fileTimes() datePairString(birthTime, beforeBirth)); QTest::qSleep(sleepTime); - beforeWrite = QDateTime::currentDateTime().addMSecs(-fsClockSkew); + beforeWrite = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew); QTextStream ts(&file); ts << fileName << Qt::endl; } @@ -1153,7 +1153,7 @@ void tst_QFileInfo::fileTimes() // --- Change the file's metadata QTest::qSleep(sleepTime); - beforeMetadataChange = QDateTime::currentDateTime(QTimeZone::UTC).addMSecs(-fsClockSkew); + beforeMetadataChange = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew); { QFile file(fileName); file.setPermissions(file.permissions()); @@ -1169,7 +1169,7 @@ void tst_QFileInfo::fileTimes() // --- Read the file QTest::qSleep(sleepTime); - beforeRead = QDateTime::currentDateTime(QTimeZone::UTC).addMSecs(-fsClockSkew); + beforeRead = QDateTime::currentDateTimeUtc().addMSecs(-fsClockSkew); { QFile file(fileName); QVERIFY(file.open(QFile::ReadOnly | QFile::Text)); diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 4bfb305ef0..2e0b79b704 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -886,7 +886,7 @@ static bool waitAndRunUpdateMimeDatabase(const QString &path) QFileInfo mimeCacheInfo(path + QString::fromLatin1("/mime.cache")); if (mimeCacheInfo.exists()) { // Wait until the beginning of the next second - while (mimeCacheInfo.lastModified(QTimeZone::UTC).secsTo(QDateTime::currentDateTime()) == 0) { + while (mimeCacheInfo.lastModified(QTimeZone::UTC).secsTo(QDateTime::currentDateTimeUtc()) == 0) { QTest::qSleep(200); } } |