diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-06 05:01:28 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-06 05:01:28 (GMT) |
commit | 51e9a75d2d26f2f7ad4cf11a730c8d6e12dc3886 (patch) | |
tree | c8e3a3f269ab168bed5187fbfafcc8fbf7246a25 | |
parent | 54e8e22a49148b089fd02895ead5c27aaf62e18e (diff) | |
download | Qt-51e9a75d2d26f2f7ad4cf11a730c8d6e12dc3886.zip Qt-51e9a75d2d26f2f7ad4cf11a730c8d6e12dc3886.tar.gz Qt-51e9a75d2d26f2f7ad4cf11a730c8d6e12dc3886.tar.bz2 |
Improve scope autotest
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/ScopeObject.qml b/tests/auto/declarative/qmlecmascript/data/ScopeObject.qml new file mode 100644 index 0000000..b7bec63 --- /dev/null +++ b/tests/auto/declarative/qmlecmascript/data/ScopeObject.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Item { + property int a: 3 + property int binding: myFunction(); + property int binding2: myCompFunction(); + + Script { + function myCompFunction() { + return a; + } + } +} + diff --git a/tests/auto/declarative/qmlecmascript/data/scope.qml b/tests/auto/declarative/qmlecmascript/data/scope.qml index 87155d1..80222c8 100644 --- a/tests/auto/declarative/qmlecmascript/data/scope.qml +++ b/tests/auto/declarative/qmlecmascript/data/scope.qml @@ -31,6 +31,10 @@ Item { property int binding4: myNestedFunction() } + ScopeObject { + id: CompObject + } + property alias test1: Root.binding property alias test2: NestedObject.binding property alias test3: Root.binding2 @@ -39,4 +43,6 @@ Item { property alias test6: NestedObject.binding3 property alias test7: Root.binding4 property alias test8: NestedObject.binding4 + property alias test9: CompObject.binding + property alias test10: CompObject.binding2 } diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 15bfe24..c69528a 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -542,6 +542,8 @@ void tst_qmlecmascript::scope() QCOMPARE(object->property("test6").toInt(), 1); QCOMPARE(object->property("test7").toInt(), 2); QCOMPARE(object->property("test8").toInt(), 2); + QCOMPARE(object->property("test9").toInt(), 1); + QCOMPARE(object->property("test10").toInt(), 3); } /* |