diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 243b6b1296..406bcb1da8 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -70,6 +70,7 @@ private slots: void brokenAs(); void boundComponents(); void callContextPropertyLookupResult(); + void callFactoryFunction(); void callObjectLookupOnNull(); void callWithSpread(); void collectGarbageDuringAotCode(); @@ -1072,6 +1073,19 @@ void tst_QmlCppCodegen::callContextPropertyLookupResult() QVERIFY(qvariant_cast<QQmlComponent *>(o->property("c")) != nullptr); } +void tst_QmlCppCodegen::callFactoryFunction() +{ + QQmlEngine engine; + QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/callFactory.qml"_s)); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + + QTest::ignoreMessage(QtDebugMsg, "Object created: 0"); + QScopedPointer<QObject> o(c.create()); + QVERIFY(o); + + QTest::ignoreMessage(QtDebugMsg, "Object destroyed: 0"); +} + void tst_QmlCppCodegen::callObjectLookupOnNull() { QQmlEngine engine; |
