diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-04 17:31:22 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-07-06 21:28:05 +0200 |
| commit | 8dc33d3672420d4a21931492b12ce6691cdab435 (patch) | |
| tree | f18bcb2613390f1695aec482455e4104a1963dd9 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 3f86e366a12949e9785cef22a7d967df0d28fefe (diff) | |
QmlCompiler: Don't crash on unknown list value types
Pick-to: 6.4
Fixes: QTBUG-104743
Change-Id: I551b21498bb746acf05be525dbcb72a74f816c04
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 4acc200249..f96efacd3f 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -129,6 +129,7 @@ private slots: void unstoredUndefined(); void registerPropagation(); void argumentConversion(); + void badSequence(); }; void tst_QmlCppCodegen::simpleBinding() @@ -2378,6 +2379,29 @@ void tst_QmlCppCodegen::argumentConversion() QCOMPARE(o->property("f").toDouble(), 10.0); } +void tst_QmlCppCodegen::badSequence() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/badSequence.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + + Person *self = qobject_cast<Person *>(o.data()); + QVERIFY(self); QVERIFY(self->barzles().isEmpty()); + + Person *other = o->property("other").value<Person *>(); + QVERIFY(other); + + QVERIFY(other->barzles().isEmpty()); + + Barzle f1; + Barzle f2; + const QList<Barzle *> barzles { &f1, &f2 }; + + other->setBarzles(barzles); + QCOMPARE(self->barzles(), barzles); +} + void tst_QmlCppCodegen::runInterpreted() { #ifdef Q_OS_ANDROID |
