From a129444bb0156c936900dbd2f12bd9f427ff366c Mon Sep 17 00:00:00 2001 From: Qt by Nokia Date: Wed, 27 Apr 2011 14:13:26 +0200 Subject: Initial import from qtquick2. Branched from the monolithic repo, Qt qtquick2 branch, at commit a4a585d2ee907746682846ae6e8a48e19deef469 --- .../declarative/qdeclarativev4/data/doubleBoolJump.qml | 18 ++++++++++++++++++ .../declarative/qdeclarativev4/data/fetchException.qml | 6 ++++++ .../declarative/qdeclarativev4/data/logicalOr.2.qml | 6 ++++++ .../auto/declarative/qdeclarativev4/data/logicalOr.qml | 6 ++++++ .../qdeclarativev4/data/nestedObjectAccess.qml | 5 +++++ .../declarative/qdeclarativev4/data/nullQObject.qml | 7 +++++++ .../qdeclarativev4/data/qrealToIntRounding.qml | 10 ++++++++++ .../data/subscriptionsInConditionalExpressions.qml | 11 +++++++++++ .../declarative/qdeclarativev4/data/unaryMinus.qml | 18 ++++++++++++++++++ .../qdeclarativev4/data/unnecessaryReeval.qml | 7 +++++++ 10 files changed, 94 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/fetchException.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/logicalOr.2.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/logicalOr.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/nestedObjectAccess.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/nullQObject.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml create mode 100644 tests/auto/declarative/qdeclarativev4/data/unnecessaryReeval.qml (limited to 'tests/auto/declarative/qdeclarativev4/data') diff --git a/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml b/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml new file mode 100644 index 0000000000..e7fb82ca36 --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/doubleBoolJump.qml @@ -0,0 +1,18 @@ +import QtQuick 1.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/declarative/qdeclarativev4/data/fetchException.qml b/tests/auto/declarative/qdeclarativev4/data/fetchException.qml new file mode 100644 index 0000000000..ece8e73199 --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/fetchException.qml @@ -0,0 +1,6 @@ +import QtQuick 1.0 + +Item { + property Item data + property int a: data.x, 1 +} diff --git a/tests/auto/declarative/qdeclarativev4/data/logicalOr.2.qml b/tests/auto/declarative/qdeclarativev4/data/logicalOr.2.qml new file mode 100644 index 0000000000..54fb78b127 --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/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/declarative/qdeclarativev4/data/logicalOr.qml b/tests/auto/declarative/qdeclarativev4/data/logicalOr.qml new file mode 100644 index 0000000000..406a7d83eb --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/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/declarative/qdeclarativev4/data/nestedObjectAccess.qml b/tests/auto/declarative/qdeclarativev4/data/nestedObjectAccess.qml new file mode 100644 index 0000000000..56cd17e41e --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/nestedObjectAccess.qml @@ -0,0 +1,5 @@ +import Qt.v4 1.0 + +Result { + result: nested.result +} diff --git a/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml b/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml new file mode 100644 index 0000000000..283c1a199b --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/nullQObject.qml @@ -0,0 +1,7 @@ +import QtQuick 1.0 + +Item { + property QtObject obj + property QtObject test + test: obj +} diff --git a/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml b/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml new file mode 100644 index 0000000000..f961910f15 --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/qrealToIntRounding.qml @@ -0,0 +1,10 @@ +import QtQuick 1.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/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml b/tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml new file mode 100644 index 0000000000..25483b207d --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/subscriptionsInConditionalExpressions.qml @@ -0,0 +1,11 @@ +import QtQuick 1.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/declarative/qdeclarativev4/data/unaryMinus.qml b/tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml new file mode 100644 index 0000000000..3cfa0492c0 --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/unaryMinus.qml @@ -0,0 +1,18 @@ +import QtQuick 1.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 + + QtObject { + id: i1 + property real p1: -3.7 + property int p2: 18 + property real p3: -3.3 + } + } + diff --git a/tests/auto/declarative/qdeclarativev4/data/unnecessaryReeval.qml b/tests/auto/declarative/qdeclarativev4/data/unnecessaryReeval.qml new file mode 100644 index 0000000000..48662d7a2d --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/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 +} -- cgit v1.2.3 From e50b7c92998905efdd40314724480e3070bdbcb5 Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 5 May 2011 17:19:01 +0200 Subject: Fix evaluation of boolean conditions Ensure that the operand of IR::OpIfTrue and IR::OpNot has boolean type. --- tests/auto/declarative/qdeclarativev4/data/conditionalExpr.qml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/auto/declarative/qdeclarativev4/data/conditionalExpr.qml (limited to 'tests/auto/declarative/qdeclarativev4/data') diff --git a/tests/auto/declarative/qdeclarativev4/data/conditionalExpr.qml b/tests/auto/declarative/qdeclarativev4/data/conditionalExpr.qml new file mode 100644 index 0000000000..b74a95a94b --- /dev/null +++ b/tests/auto/declarative/qdeclarativev4/data/conditionalExpr.qml @@ -0,0 +1,6 @@ +import Qt.v4 1.0 + +Result { + property int n: 2 + result: !n ? 100 : 0 +} -- cgit v1.2.3