diff options
Diffstat (limited to 'tests/auto/qml/v4/data')
-rw-r--r-- | tests/auto/qml/v4/data/conditionalExpr.qml | 6 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/doubleBoolJump.qml | 18 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/fetchException.qml | 6 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/logicalOr.2.qml | 6 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/logicalOr.qml | 6 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/nestedLogicalOr.qml | 14 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/nestedObjectAccess.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/nullQObject.qml | 7 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/qrealToIntRounding.qml | 10 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/qtbug_21883.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/qtbug_22816.qml | 18 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/stringComparison.qml | 34 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/subscriptionsInConditionalExpressions.qml | 11 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/unaryMinus.qml | 24 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/unaryPlus.qml | 24 | ||||
-rw-r--r-- | tests/auto/qml/v4/data/unnecessaryReeval.qml | 7 |
16 files changed, 201 insertions, 0 deletions
diff --git a/tests/auto/qml/v4/data/conditionalExpr.qml b/tests/auto/qml/v4/data/conditionalExpr.qml new file mode 100644 index 0000000000..b74a95a94b --- /dev/null +++ b/tests/auto/qml/v4/data/conditionalExpr.qml @@ -0,0 +1,6 @@ +import Qt.v4 1.0 + +Result { + property int n: 2 + result: !n ? 100 : 0 +} diff --git a/tests/auto/qml/v4/data/doubleBoolJump.qml b/tests/auto/qml/v4/data/doubleBoolJump.qml new file mode 100644 index 0000000000..2eea73b573 --- /dev/null +++ b/tests/auto/qml/v4/data/doubleBoolJump.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 + +Rectangle { + QtObject { + property real output: i1.p1 || i2.p2 == "text" ? 0.7 : 0 + } + + QtObject { + id: i2 + property string p2 + } + + QtObject { + id: i1 + property bool p1: false + } +} + diff --git a/tests/auto/qml/v4/data/fetchException.qml b/tests/auto/qml/v4/data/fetchException.qml new file mode 100644 index 0000000000..6431fcfae8 --- /dev/null +++ b/tests/auto/qml/v4/data/fetchException.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Item { + property Item data + property int a: data.x, 1 +} diff --git a/tests/auto/qml/v4/data/logicalOr.2.qml b/tests/auto/qml/v4/data/logicalOr.2.qml new file mode 100644 index 0000000000..54fb78b127 --- /dev/null +++ b/tests/auto/qml/v4/data/logicalOr.2.qml @@ -0,0 +1,6 @@ +import Qt.v4 1.0 + +Result { + property string s: "foo" || "bar" + result: s == "foo" +} diff --git a/tests/auto/qml/v4/data/logicalOr.qml b/tests/auto/qml/v4/data/logicalOr.qml new file mode 100644 index 0000000000..406a7d83eb --- /dev/null +++ b/tests/auto/qml/v4/data/logicalOr.qml @@ -0,0 +1,6 @@ +import Qt.v4 1.0 + +Result { + property int a: 10 + result: a == 1 || a == 2 +} diff --git a/tests/auto/qml/v4/data/nestedLogicalOr.qml b/tests/auto/qml/v4/data/nestedLogicalOr.qml new file mode 100644 index 0000000000..c4478a3e7b --- /dev/null +++ b/tests/auto/qml/v4/data/nestedLogicalOr.qml @@ -0,0 +1,14 @@ +import Qt.v4 1.0 + +Result { + property bool val1: false + property bool val2: true + property bool val3: false + + property bool b1: (false || false || true) + property bool b2: (false || (false || true)) + property bool b3: ((false || false) || true) + property bool b4: (val1 || (val2 || val3)) ? true : false + + result: b1 && b2 && b3 && b4 +} diff --git a/tests/auto/qml/v4/data/nestedObjectAccess.qml b/tests/auto/qml/v4/data/nestedObjectAccess.qml new file mode 100644 index 0000000000..56cd17e41e --- /dev/null +++ b/tests/auto/qml/v4/data/nestedObjectAccess.qml @@ -0,0 +1,5 @@ +import Qt.v4 1.0 + +Result { + result: nested.result +} diff --git a/tests/auto/qml/v4/data/nullQObject.qml b/tests/auto/qml/v4/data/nullQObject.qml new file mode 100644 index 0000000000..00185b3988 --- /dev/null +++ b/tests/auto/qml/v4/data/nullQObject.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Item { + property QtObject obj + property QtObject test + test: obj +} diff --git a/tests/auto/qml/v4/data/qrealToIntRounding.qml b/tests/auto/qml/v4/data/qrealToIntRounding.qml new file mode 100644 index 0000000000..ee3d405073 --- /dev/null +++ b/tests/auto/qml/v4/data/qrealToIntRounding.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 + +QtObject { + property int data: 1 + + property int test1: 6.6 + data + property int test2: 6.2 + data + property int test3: 6 + data +} + diff --git a/tests/auto/qml/v4/data/qtbug_21883.qml b/tests/auto/qml/v4/data/qtbug_21883.qml new file mode 100644 index 0000000000..a51f97c944 --- /dev/null +++ b/tests/auto/qml/v4/data/qtbug_21883.qml @@ -0,0 +1,5 @@ +import Qt.v4 1.0 + +Result { + property Result dummy: Result +} diff --git a/tests/auto/qml/v4/data/qtbug_22816.qml b/tests/auto/qml/v4/data/qtbug_22816.qml new file mode 100644 index 0000000000..bfa8d4948c --- /dev/null +++ b/tests/auto/qml/v4/data/qtbug_22816.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 + +Item { + QtObject { + id: object + property bool prop1: true + function myfunction() { return true; } + property bool prop2: object.prop1 && myfunction(); + } + + property bool test1: object.prop1 && object.prop2 + property bool test2: object.prop1 + + Component.onCompleted: { + object.prop1 = false; + } +} + diff --git a/tests/auto/qml/v4/data/stringComparison.qml b/tests/auto/qml/v4/data/stringComparison.qml new file mode 100644 index 0000000000..64b6798c69 --- /dev/null +++ b/tests/auto/qml/v4/data/stringComparison.qml @@ -0,0 +1,34 @@ +import QtQuick 2.0 + +QtObject { + property string string1: "aaba" + property string string2: "aa" + property string string3: "aaab" + property string string4: "c" + + property bool test1: string1 > string2 + property bool test2: string2 < string1 + property bool test3: string1 > string3 + property bool test4: string3 < string1 + property bool test5: string1 < string4 + property bool test6: string4 > string1 + + property bool test7: string1 == "aaba" + property bool test8: string1 != "baa" + property bool test9: string1 === "aaba" + property bool test10: string1 !== "baa" + property bool test11: string4 == "c" + property bool test12: string4 != "d" + property bool test13: string4 === "c" + property bool test14: string4 !== "d" + + property bool test15: string1 >= string2 + property bool test16: string2 <= string1 + property bool test17: string1 >= string3 + property bool test18: string3 <= string1 + property bool test19: string1 <= string4 + property bool test20: string4 >= string1 + property bool test21: string4 <= "c" + property bool test22: string4 >= "c" +} + diff --git a/tests/auto/qml/v4/data/subscriptionsInConditionalExpressions.qml b/tests/auto/qml/v4/data/subscriptionsInConditionalExpressions.qml new file mode 100644 index 0000000000..a8e05eeda1 --- /dev/null +++ b/tests/auto/qml/v4/data/subscriptionsInConditionalExpressions.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Item { + id: thisTest + + property bool cond: true + property real a: 1 + property real result: cond ? a : a + + PropertyAction { running: true; target: thisTest; property: "a"; value: 2; } +} diff --git a/tests/auto/qml/v4/data/unaryMinus.qml b/tests/auto/qml/v4/data/unaryMinus.qml new file mode 100644 index 0000000000..410654fc3c --- /dev/null +++ b/tests/auto/qml/v4/data/unaryMinus.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 + +Item { + property real test1: -i1.p2 + property int test2: -i1.p2 + property real test3: -i1.p1 + property int test4: -i1.p1 + property real test5: -i1.p3 + property int test6: -i1.p3 + property real test7: -i1.p4 + property int test8: -i1.p4 + property real test9: -i1.p5 + property int test10: -i1.p5 + + QtObject { + id: i1 + property real p1: -3.7 + property int p2: 18 + property real p3: -3.3 + property int p4: -7 + property real p5: 4.4 + } + } + diff --git a/tests/auto/qml/v4/data/unaryPlus.qml b/tests/auto/qml/v4/data/unaryPlus.qml new file mode 100644 index 0000000000..cd5315a7cc --- /dev/null +++ b/tests/auto/qml/v4/data/unaryPlus.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 + +Item { + property real test1: +i1.p2 + property int test2: +i1.p2 + property real test3: +i1.p1 + property int test4: +i1.p1 + property real test5: +i1.p3 + property int test6: +i1.p3 + property real test7: +i1.p4 + property int test8: +i1.p4 + property real test9: +i1.p5 + property int test10: +i1.p5 + + QtObject { + id: i1 + property real p1: -3.7 + property int p2: 18 + property real p3: -3.3 + property int p4: -7 + property real p5: 4.4 + } +} + diff --git a/tests/auto/qml/v4/data/unnecessaryReeval.qml b/tests/auto/qml/v4/data/unnecessaryReeval.qml new file mode 100644 index 0000000000..48662d7a2d --- /dev/null +++ b/tests/auto/qml/v4/data/unnecessaryReeval.qml @@ -0,0 +1,7 @@ +import Qt.v4 1.0 + +Result { + property int a: 8 + property int b: 19 + result: (a == 8)?b:7 +} |