~ubuntu-branches/ubuntu/saucy/qtdeclarative-opensource-src/saucy

« back to all changes in this revision

Viewing changes to tests/auto/qml/qqmlecmascript/data/readonlyDeclaration.qml

  • Committer: Package Import Robot
  • Author(s): Timo Jyrinki
  • Date: 2013-02-05 14:17:19 UTC
  • Revision ID: package-import@ubuntu.com-20130205141719-qqeyml8wslpyez52
Tags: upstream-5.0.1
ImportĀ upstreamĀ versionĀ 5.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import QtQuick 2.0
 
2
 
 
3
QtObject {
 
4
    property int dummy: 13
 
5
 
 
6
    readonly property int test1: 19
 
7
    readonly property int test2: dummy * 49
 
8
    readonly property alias test3: other.test
 
9
 
 
10
    property bool test: false
 
11
 
 
12
    property var dummyObj: QtObject {
 
13
        id: other
 
14
        property int test: 9
 
15
    }
 
16
 
 
17
    Component.onCompleted: {
 
18
        if (test1 != 19) return;
 
19
        if (test2 != 637) return;
 
20
        if (test3 != 9) return;
 
21
 
 
22
        var caught = false;
 
23
 
 
24
        caught = false;
 
25
        try { test1 = 13 } catch (e) { caught = true; }
 
26
        if (!caught) return;
 
27
 
 
28
        caught = false;
 
29
        try { test2 = 13 } catch (e) { caught = true; }
 
30
        if (!caught) return;
 
31
 
 
32
        caught = false;
 
33
        try { test3 = 13 } catch (e) { caught = true; }
 
34
        if (!caught) return;
 
35
 
 
36
        other.test = 13;
 
37
        dummy = 9;
 
38
 
 
39
        if (test1 != 19) return;
 
40
        if (test2 != 441) return;
 
41
        if (test3 != 13) return;
 
42
 
 
43
        test = true;
 
44
    }
 
45
}