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.cpp14
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 db6e6159a0..f732998647 100644
--- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
+++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
@@ -71,6 +71,7 @@ private slots:
void conversionDecrement();
void conversionInDeadCode();
void conversions();
+ void convertPrimitiveToVar();
void convertQJSPrimitiveValueToIntegral();
void convertToOriginalReadAcumulatorForUnaryOperators();
void cppValueTypeList();
@@ -1307,6 +1308,19 @@ void tst_QmlCppCodegen::conversions()
QVERIFY(!undef.isValid());
}
+void tst_QmlCppCodegen::convertPrimitiveToVar()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, QUrl(u"qrc:/qt/qml/TestTypes/convertPrimitiveToVar.qml"_s));
+
+ QVERIFY2(c.isReady(), qPrintable(c.errorString()));
+
+ QScopedPointer<QObject> o(c.create());
+ QVERIFY(!o.isNull());
+
+ QCOMPARE(o->property("offsetValue").toInt(), 41);
+}
+
void tst_QmlCppCodegen::convertQJSPrimitiveValueToIntegral()
{
QQmlEngine engine;