aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
-rw-r--r--tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index 9a330c4c06..3b1c5d47fe 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -159,6 +159,7 @@ private slots:
void popContextAfterRet();
void prefixedType();
void propertyOfParent();
+ void reduceWithNullThis();
void readEnumFromInstance();
void registerElimination();
void registerPropagation();
@@ -3370,6 +3371,18 @@ void tst_QmlCppCodegen::propertyOfParent()
}
}
+void tst_QmlCppCodegen::reduceWithNullThis()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/reduceWithNullThis.qml"_s));
+ QVERIFY2(component.isReady(), component.errorString().toUtf8());
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+
+ QCOMPARE(object->property("preferredHeight").toDouble(), 28.0);
+ QCOMPARE(object->property("preferredHeight2").toDouble(), 28.0);
+}
+
void tst_QmlCppCodegen::readEnumFromInstance()
{
QQmlEngine engine;