diff options
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 13 |
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 3f0e2a4569..37f874ba91 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 compareOriginals(); void comparisonTypes(); void componentReturnType(); void compositeSingleton(); @@ -967,6 +968,18 @@ void tst_QmlCppCodegen::colorString() QCOMPARE(qvariant_cast<QColor>(rootObject->property("e")), QColor::fromRgb(0x11, 0x22, 0x33)); } +void tst_QmlCppCodegen::compareOriginals() +{ + QQmlEngine engine; + QQmlComponent component(&engine, QUrl(u"qrc:/qt/qml/TestTypes/compareOriginals.qml"_s)); + QVERIFY2(!component.isError(), component.errorString().toUtf8()); + QScopedPointer<QObject> object(component.create()); + QVERIFY(!object.isNull()); + + QCOMPARE(object->property("compareOriginals").toInt(), 5); + QVERIFY(object->property("optionalThis").toBool()); +} + void tst_QmlCppCodegen::comparisonTypes() { QQmlEngine engine; |
