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.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
index b8364a51b2..fedcd477a0 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -59,6 +59,7 @@ private slots:
void callWithSpread();
void colorAsVariant();
void colorString();
+ void comparisonTypes();
void componentReturnType();
void compositeSingleton();
void compositeTypeMethod();
@@ -965,6 +966,21 @@ void tst_QmlCppCodegen::colorString()
QCOMPARE(qvariant_cast<QColor>(rootObject->property("e")), QColor::fromRgb(0x11, 0x22, 0x33));
}
+void tst_QmlCppCodegen::comparisonTypes()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/comparisonTypes.qml"_s));
+ QVERIFY2(!component.isError(), component.errorString().toUtf8());
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY(!object.isNull());
+
+ QCOMPARE(object->property("found").toInt(), 1);
+ QCOMPARE(object->property("foundStrict").toInt(), 0);
+
+ QCOMPARE(object->property("foundNot").toInt(), 2);
+ QCOMPARE(object->property("foundNotStrict").toInt(), 10);
+}
+
void tst_QmlCppCodegen::componentReturnType()
{
QQmlEngine engine;