aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmldiskcache
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-11-22 15:35:57 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-23 09:38:24 +0000
commitd236661940b09194cc6a864ffbe687569922787e (patch)
treee82a44660107d7f61e16ed002f75b716fa2ce7e5 /tests/auto/qml/qmldiskcache
parent07cde200e55ee03bf9e2f9af89c20f91072deccc (diff)
Fix qrc test
Make this test pass when we have the time stamp available in the qrc data (since commit d20773824529d191e7b483b505107dce6c1b1c3d in qtbase) or when not (when the engine falls back to the program executable). Change-Id: Idb9a6951d76515a2482d573b40da99871bc442cd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qmldiskcache')
-rw-r--r--tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
index e2c0055ea1..f8698f0afa 100644
--- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
+++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp
@@ -563,7 +563,11 @@ void tst_qmldiskcache::cacheResources()
QVERIFY2(cacheFile.open(QIODevice::ReadOnly), qPrintable(cacheFile.errorString()));
QV4::CompiledData::Unit unit;
QVERIFY(cacheFile.read(reinterpret_cast<char *>(&unit), sizeof(unit)) == sizeof(unit));
- QCOMPARE(qint64(unit.sourceTimeStamp), QFileInfo(QCoreApplication::applicationFilePath()).lastModified().toMSecsSinceEpoch());
+
+ QDateTime referenceTimeStamp = QFileInfo(":/test.qml").lastModified();
+ if (!referenceTimeStamp.isValid())
+ referenceTimeStamp = QFileInfo(QCoreApplication::applicationFilePath()).lastModified();
+ QCOMPARE(qint64(unit.sourceTimeStamp), referenceTimeStamp.toMSecsSinceEpoch());
}
}