diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:29:45 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2022-09-12 18:29:45 +0300 |
commit | da0aac1057552048f59075beb31861a6cc076684 (patch) | |
tree | 020cd8784f01248ea051bbf70254b8bcb3100a23 /tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | |
parent | f274d775774b78f6217c9770ae87045d969acbe1 (diff) | |
parent | 4757cac470edbeaeaceca4e63075d9f1139f546b (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Change-Id: I658cff3c394ed233005efe6b12c515d2a886ef6b
Diffstat (limited to 'tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp')
-rw-r--r-- | tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp index 3810f505b3..65137c65a2 100644 --- a/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp +++ b/tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp @@ -37,6 +37,7 @@ #include <QLoggingCategory> #include <private/qqmlcomponent_p.h> #include <private/qqmlscriptdata_p.h> +#include <private/qv4compileddata_p.h> #include <qtranslator.h> #include "../../shared/util.h" @@ -78,6 +79,8 @@ private slots: void parameterAdjustment(); void inlineComponent(); void posthocRequired(); + + void saveableUnitPointer(); }; // A wrapper around QQmlComponent to ensure the temporary reference counts @@ -713,6 +716,18 @@ void tst_qmlcachegen::posthocRequired() QVERIFY(component.errorString().contains(QStringLiteral("Required property x was not initialized"))); } +void tst_qmlcachegen::saveableUnitPointer() +{ + QV4::CompiledData::Unit unit; + unit.flags = QV4::CompiledData::Unit::StaticData | QV4::CompiledData::Unit::IsJavascript; + const auto flags = unit.flags; + + QV4::CompiledData::SaveableUnitPointer pointer(&unit); + + QVERIFY(pointer.saveToDisk<char>([](const char *, quint32) { return true; })); + QCOMPARE(unit.flags, flags); +} + QTEST_GUILESS_MAIN(tst_qmlcachegen) #include "tst_qmlcachegen.moc" |