diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-27 17:10:29 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-31 07:28:03 +0000 |
commit | 8e45393d10ca649c46a82eb8c125bd38cc5b5615 (patch) | |
tree | e63fdc8496060347e24cf4b1ed88f530227b5027 /tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp | |
parent | e56eeee9902ffc341506040e637654b2b0451209 (diff) |
Fix import of precompiled .js files
Loading those must not fail the file relocation test, so set the source
file names to empty, as we also do for .qml files.
Also added tests for all the scenarios: no embedded file paths for AOT
files but absolute paths for run-time created cache files.
Change-Id: I3fc92e89cfd0da512afeac22bd0da3e915ec46ea
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp')
-rw-r--r-- | tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp index 20eef9c322..917ac9e74e 100644 --- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp +++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp @@ -495,6 +495,10 @@ void tst_qmldiskcache::recompileAfterDirectoryChange() testCompiler.clearCache(); QVERIFY2(testCompiler.compile(contents), qPrintable(testCompiler.lastErrorString)); QVERIFY2(testCompiler.verify(), qPrintable(testCompiler.lastErrorString)); + const QV4::CompiledData::Unit *unit = testCompiler.mapUnit(); + QVERIFY(unit->sourceFileIndex != 0); + const QString expectedPath = QUrl::fromLocalFile(testCompiler.testFilePath).toString(); + QCOMPARE(unit->stringAt(unit->sourceFileIndex), expectedPath); testCompiler.closeMapping(); } |