diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-03-13 16:24:49 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-20 05:37:59 +0100 |
commit | 89c57d2859a2bb2d64f876b3458e090eb6f77b8b (patch) | |
tree | 4ea0bb2cd1f108a4be09d4e861ed608021e20811 /tests | |
parent | 47e0817973ed4e992d8cb537c49bdaa3c4fc2168 (diff) |
Support null -> QObject and QObject -> bool conversions in v4.
Change-Id: I66602bf52986a388f9b6fe2bcd4630b862138906
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
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() |