aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-11-28 09:37:03 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-29 10:12:44 +0100
commit7c83628f5e594cc91f4e3bfde32d0062f85d5ec4 (patch)
treed43242b7646f603e506c872f850118c387dedfe9 /tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml
parent328d1d2fd6cba7368230a1232e080d3f3310a7f1 (diff)
Fix the evaluation of JS switch statements in QML bindings.
Task-number: QTBUG-17012 Change-Id: Ic132cf63ed08592fec9c759df1b8b4d5830acea6 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml b/tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml
new file mode 100644
index 0000000000..43ba199a04
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeecmascript/data/switchStatement.4.qml
@@ -0,0 +1,31 @@
+import Qt.test 1.0
+
+MyQmlObject {
+ value: {
+ var value = 0
+ switch (stringProperty) {
+ case "A":
+ value = value + 1
+ value = value + 1
+ /* should fall through */
+ case "S":
+ value = value + 1
+ value = value + 1
+ value = value + 1
+ break;
+ case "D": { // with curly braces
+ value = value + 1
+ value = value + 1
+ value = value + 1
+ break;
+ }
+ case "F": {
+ value = value + 1
+ value = value + 1
+ value = value + 1
+ }
+ /* should fall through */
+ }
+ }
+}
+