diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 674bfdef5d..0c9648a19d 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -133,6 +133,7 @@ private slots: void mathMinMax(); void mathOperations(); void mergedObjectReadWrite(); + void methodOnListLookup(); void methods(); void modulePrefix(); void multiForeign(); @@ -2666,6 +2667,25 @@ void tst_QmlCppCodegen::mergedObjectReadWrite() } } +void tst_QmlCppCodegen::methodOnListLookup() +{ + QQmlEngine engine; + const QUrl url(u"qrc:/qt/qml/TestTypes/methodOnListLookup.qml"_s); + QQmlComponent component(&engine, url); + QVERIFY2(component.isReady(), qPrintable(component.errorString())); + + QScopedPointer<QObject> o(component.create()); + QVERIFY(!o.isNull()); + + QCOMPARE(o->objectName(), u"no one"); + + QTest::ignoreMessage( + QtWarningMsg, + qPrintable(url.toString() + + ":14: TypeError: Cannot call method 'getName' of undefined"_L1)); + QMetaObject::invokeMethod(o.data(), "boom"); +} + void tst_QmlCppCodegen::methods() { QQmlEngine engine; |
