--- /dev/null
+import QtQuick 1.0
+
+QtObject {
+ id: root
+
+ property bool test_true1: false
+ property bool test_true2: false
+ property bool test_true3: false
+ property bool test_true4: false
+ property bool test_true5: false
+
+ property bool test_false1: true
+ property bool test_false2: true
+ property bool test_false3: true
+
+
+ Component.onCompleted: {
+ test_true1 = 11
+ test_true2 = "Hello"
+ test_true3 = root
+ test_true4 = { a: 10, b: 11 }
+ test_true5 = true
+
+ test_false1 = 0
+ test_false2 = null
+ test_false3 = false
+ }
+}
void propertyChangeSlots();
void elementAssign();
void objectPassThroughSignals();
+ void booleanConversion();
void bug1();
void bug2();
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()