From d236661940b09194cc6a864ffbe687569922787e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 22 Nov 2016 15:35:57 +0100 Subject: 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 --- tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/auto') 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(&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()); } } -- cgit v1.2.3