diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index aafae1ea54..d73da28212 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -150,6 +150,7 @@ private slots: void propertyChangeSlots(); void elementAssign(); void objectPassThroughSignals(); + void booleanConversion(); void bug1(); void bug2(); @@ -2938,6 +2939,27 @@ void tst_qdeclarativeecmascript::objectPassThroughSignals() delete object; } +// QTBUG-20242 +void tst_qdeclarativeecmascript::booleanConversion() +{ + QDeclarativeComponent component(&engine, TEST_FILE("booleanConversion.qml")); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test_true1").toBool(), true); + QCOMPARE(object->property("test_true2").toBool(), true); + QCOMPARE(object->property("test_true3").toBool(), true); + QCOMPARE(object->property("test_true4").toBool(), true); + QCOMPARE(object->property("test_true5").toBool(), true); + + QCOMPARE(object->property("test_false1").toBool(), false); + QCOMPARE(object->property("test_false2").toBool(), false); + QCOMPARE(object->property("test_false3").toBool(), false); + + delete object; +} + // Test that assigning a null object works // Regressed with: df1788b4dbbb2826ae63f26bdf166342595343f4 void tst_qdeclarativeecmascript::nullObjectBinding() |