diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-23 09:42:16 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-31 17:08:00 +0000 |
commit | 9337b1c339c34cd4fe10d236be2ee61ca76e17ba (patch) | |
tree | 4fa5482063e447dc7d9988069cdeafd255e8933b /tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp | |
parent | 0a0e6e2ad2ed8224b5c1b6cd179677198e87288c (diff) |
Clean up compilation unit string resolution
Replace use of CompiledData::Unit::stringAt with
CompilationUnit::stringAt as central place, in preparation for allowing
derived compilation units to retrieve strings from base units.
Change-Id: Ifafe6c18a9fd8d1e2259a60c17200124869b4c2d
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 | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp index fa50997ae7..5c70aed256 100644 --- a/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp +++ b/tests/auto/qml/qmldiskcache/tst_qmldiskcache.cpp @@ -282,7 +282,7 @@ void tst_qmldiskcache::regenerateAfterChange() QCOMPARE(quint32(testUnit->functionTableSize), quint32(1)); const QV4::CompiledData::Function *bindingFunction = testUnit->functionAt(0); - QCOMPARE(testUnit->stringAt(bindingFunction->nameIndex), QString("expression for blah")); // check if we have the correct function + QCOMPARE(testUnit->stringAtInternal(bindingFunction->nameIndex), QString("expression for blah")); // check if we have the correct function QVERIFY(bindingFunction->codeSize > 0); QVERIFY(bindingFunction->codeOffset < testUnit->unitSize); } @@ -308,7 +308,7 @@ void tst_qmldiskcache::regenerateAfterChange() QCOMPARE(quint32(testUnit->functionTableSize), quint32(1)); const QV4::CompiledData::Function *bindingFunction = testUnit->functionAt(0); - QCOMPARE(testUnit->stringAt(bindingFunction->nameIndex), QString("expression for blah")); // check if we have the correct function + QCOMPARE(testUnit->stringAtInternal(bindingFunction->nameIndex), QString("expression for blah")); // check if we have the correct function QVERIFY(bindingFunction->codeSize > 0); QVERIFY(bindingFunction->codeOffset < testUnit->unitSize); } @@ -332,12 +332,12 @@ void tst_qmldiskcache::registerImportForImplicitComponent() QVERIFY2(testUnit, qPrintable(testCompiler.lastErrorString)); QCOMPARE(quint32(testUnit->nImports), quint32(2)); - QCOMPARE(testUnit->stringAt(testUnit->importAt(0)->uriIndex), QStringLiteral("QtQuick")); + QCOMPARE(testUnit->stringAtInternal(testUnit->importAt(0)->uriIndex), QStringLiteral("QtQuick")); QQmlType componentType = QQmlMetaType::qmlType(&QQmlComponent::staticMetaObject); - QCOMPARE(testUnit->stringAt(testUnit->importAt(1)->uriIndex), QString(componentType.module())); - QCOMPARE(testUnit->stringAt(testUnit->importAt(1)->qualifierIndex), QStringLiteral("QmlInternals")); + QCOMPARE(testUnit->stringAtInternal(testUnit->importAt(1)->uriIndex), QString(componentType.module())); + QCOMPARE(testUnit->stringAtInternal(testUnit->importAt(1)->qualifierIndex), QStringLiteral("QmlInternals")); QCOMPARE(quint32(testUnit->nObjects), quint32(3)); @@ -346,7 +346,7 @@ void tst_qmldiskcache::registerImportForImplicitComponent() QCOMPARE(quint32(obj->bindingTable()->type), quint32(QV4::CompiledData::Binding::Type_Object)); const QV4::CompiledData::Object *implicitComponent = testUnit->objectAt(obj->bindingTable()->value.objectIndex); - QCOMPARE(testUnit->stringAt(implicitComponent->inheritedTypeNameIndex), QStringLiteral("QmlInternals.") + componentType.elementName()); + QCOMPARE(testUnit->stringAtInternal(implicitComponent->inheritedTypeNameIndex), QStringLiteral("QmlInternals.") + componentType.elementName()); } } @@ -498,7 +498,7 @@ void tst_qmldiskcache::recompileAfterDirectoryChange() 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); + QCOMPARE(unit->stringAtInternal(unit->sourceFileIndex), expectedPath); testCompiler.closeMapping(); } |