diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 7b89709923..c45750caac 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -320,6 +320,7 @@ private slots: void idsAsLValues(); void qtbug_34792(); void noCaptureWhenWritingProperty(); + void singletonWithEnum(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -7507,6 +7508,18 @@ void tst_qqmlecmascript::noCaptureWhenWritingProperty() QCOMPARE(obj->property("somePropertyEvaluated").toBool(), false); } +void tst_qqmlecmascript::singletonWithEnum() +{ + QQmlComponent component(&engine, testFileUrl("singletontype/singletonWithEnum.qml")); + QScopedPointer<QObject> obj(component.create()); + if (obj.isNull()) + qDebug() << component.errors().first().toString(); + QVERIFY(!obj.isNull()); + QVariant prop = obj->property("testValue"); + QVERIFY(prop.type() == QVariant::Int); + QCOMPARE(prop.toInt(), int(SingletonWithEnum::TestValue)); +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" |