diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-04-09 11:35:02 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-04-21 22:34:46 +0200 |
commit | fc3f603d0067c34356a838b652b94042dc264cd5 (patch) | |
tree | 1844a5b6fba375b62a1ea6db2e55c4cf7f7d6565 /tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | |
parent | f31a2dc6fc713ee06ea7a9ba45c3ceaace7d735d (diff) |
Prepare for new members in QQmlPrivate::CachedQmlUnit
Pass the address of the entire structure through to the compiler, so
that when adding new members we can easily access them.
Change-Id: I5da75ba4e64d3e0e750a3ff3df4edbb88cdb6937
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp')
-rw-r--r-- | tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index f940f9c476..6e6c9d7346 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -367,11 +367,11 @@ void tst_qmlcachegen::versionChecksForAheadOfTimeUnits() Q_ASSERT(!temporaryModifiedCachedUnit); QQmlMetaType::CachedUnitLookupError error = QQmlMetaType::CachedUnitLookupError::NoError; - const QV4::CompiledData::Unit *originalUnit = QQmlMetaType::findCachedCompilationUnit( + const QQmlPrivate::CachedQmlUnit *originalUnit = QQmlMetaType::findCachedCompilationUnit( QUrl("qrc:/data/versionchecks.qml"), &error); QVERIFY(originalUnit); - QV4::CompiledData::Unit *tweakedUnit = (QV4::CompiledData::Unit *)malloc(originalUnit->unitSize); - memcpy(reinterpret_cast<void *>(tweakedUnit), reinterpret_cast<const void *>(originalUnit), originalUnit->unitSize); + QV4::CompiledData::Unit *tweakedUnit = (QV4::CompiledData::Unit *)malloc(originalUnit->qmlData->unitSize); + memcpy(reinterpret_cast<void *>(tweakedUnit), reinterpret_cast<const void *>(originalUnit), originalUnit->qmlData->unitSize); tweakedUnit->version = QV4_DATA_STRUCTURE_VERSION - 1; temporaryModifiedCachedUnit = new QQmlPrivate::CachedQmlUnit{tweakedUnit, nullptr, nullptr}; @@ -596,11 +596,11 @@ void tst_qmlcachegen::moduleScriptImport() QVERIFY(unitData->flags & QV4::CompiledData::Unit::IsESModule); QQmlMetaType::CachedUnitLookupError error = QQmlMetaType::CachedUnitLookupError::NoError; - const QV4::CompiledData::Unit *unitFromResources = QQmlMetaType::findCachedCompilationUnit( + const QQmlPrivate::CachedQmlUnit *unitFromResources = QQmlMetaType::findCachedCompilationUnit( QUrl("qrc:/data/script.mjs"), &error); QVERIFY(unitFromResources); - QCOMPARE(unitFromResources, compilationUnit->unitData()); + QCOMPARE(unitFromResources->qmlData, compilationUnit->unitData()); } } @@ -627,11 +627,11 @@ void tst_qmlcachegen::sourceFileIndices() QVERIFY(QFileInfo(":/data/versionchecks.qml").size() > 0); QQmlMetaType::CachedUnitLookupError error = QQmlMetaType::CachedUnitLookupError::NoError; - const QV4::CompiledData::Unit *unitFromResources = QQmlMetaType::findCachedCompilationUnit( + const QQmlPrivate::CachedQmlUnit *unitFromResources = QQmlMetaType::findCachedCompilationUnit( QUrl("qrc:/data/versionchecks.qml"), &error); QVERIFY(unitFromResources); - QVERIFY(unitFromResources->flags & QV4::CompiledData::Unit::PendingTypeCompilation); - QCOMPARE(uint(unitFromResources->sourceFileIndex), uint(0)); + QVERIFY(unitFromResources->qmlData->flags & QV4::CompiledData::Unit::PendingTypeCompilation); + QCOMPARE(uint(unitFromResources->qmlData->sourceFileIndex), uint(0)); } void tst_qmlcachegen::reproducibleCache_data() |