diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index ec5f400fe2..881253f3ea 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -206,6 +206,7 @@ private slots: void variantMapLookup(); void variantReturn(); void variantlist(); + void voidConversion(); void voidFunction(); }; @@ -4189,6 +4190,23 @@ void tst_QmlCppCodegen::variantlist() QCOMPARE(things[1].toInt(), 30); } +void tst_QmlCppCodegen::voidConversion() +{ + QQmlEngine engine; + const QUrl url(u"qrc:/qt/qml/TestTypes/voidConversion.qml"_s); + QQmlComponent c(&engine, url); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + + QTest::ignoreMessage( + QtWarningMsg, + qPrintable(url.toString() + u":8: Error: Cannot assign [undefined] to QPointF"_s)); + + QScopedPointer<QObject> o(c.create()); + QVERIFY(o); + + QCOMPARE(o->property("p"), QPointF(20, 10)); +} + void tst_QmlCppCodegen::voidFunction() { QQmlEngine engine; |
