diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qml/v4/data/objectToBool.qml | 16 | ||||
-rw-r--r-- | tests/auto/qml/v4/tst_v4.cpp | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/v4/data/objectToBool.qml b/tests/auto/qml/v4/data/objectToBool.qml new file mode 100644 index 0000000000..8c8a67bee0 --- /dev/null +++ b/tests/auto/qml/v4/data/objectToBool.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 + +QtObject { + property QtObject prop1: null + property QtObject prop2: QtObject {} + + property bool test1: prop1 ? true : false + property bool test2: prop2 ? true : false + + property bool test3: prop1 == false + property bool test4: prop1 === false + + property bool test5: prop2 == false + property bool test6: prop2 === false +} + diff --git a/tests/auto/qml/v4/tst_v4.cpp b/tests/auto/qml/v4/tst_v4.cpp index 1c89617157..8c811f230e 100644 --- a/tests/auto/qml/v4/tst_v4.cpp +++ b/tests/auto/qml/v4/tst_v4.cpp @@ -133,6 +133,7 @@ void tst_v4::qtscript_data() QTest::newRow("double bool jump") << "doubleBoolJump.qml"; QTest::newRow("unary minus") << "unaryMinus.qml"; QTest::newRow("null qobject") << "nullQObject.qml"; + QTest::newRow("qobject -> bool") << "objectToBool.qml"; } void tst_v4::unnecessaryReeval() |