aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-23 10:40:41 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-31 05:13:48 +0000
commite56eeee9902ffc341506040e637654b2b0451209 (patch)
treeb316f49506739e96e85dfe25bb7759703bcb95f7 /tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
parent4ac9cf78969436dae456c8fec4a0a706a3d65ec4 (diff)
Encapsulate the unit data in CompilationUnit
This allows updating the constants table when the unit data is set / changes and removes the tie to the engine. Change-Id: Ice553650390589e30e18421c4e55422a55d0df89 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp')
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index f3569c2efe..1773164e69 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -2200,12 +2200,12 @@ void tst_qqmllanguage::scriptStringWithoutSourceCode()
QQmlRefPointer<QQmlTypeData> td = eng->typeLoader.getType(url);
Q_ASSERT(td);
- const QV4::CompiledData::Unit *readOnlyQmlUnit = td->compilationUnit()->data;
+ const QV4::CompiledData::Unit *readOnlyQmlUnit = td->compilationUnit()->unitData();
Q_ASSERT(readOnlyQmlUnit);
QV4::CompiledData::Unit *qmlUnit = reinterpret_cast<QV4::CompiledData::Unit *>(malloc(readOnlyQmlUnit->unitSize));
memcpy(qmlUnit, readOnlyQmlUnit, readOnlyQmlUnit->unitSize);
qmlUnit->flags &= ~QV4::CompiledData::Unit::StaticData;
- td->compilationUnit()->data = qmlUnit;
+ td->compilationUnit()->setUnitData(qmlUnit);
const QV4::CompiledData::Object *rootObject = qmlUnit->objectAt(/*root object*/0);
QCOMPARE(qmlUnit->stringAt(rootObject->inheritedTypeNameIndex), QString("MyTypeObject"));