summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-01-09 09:04:15 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-01-09 09:04:15 (GMT)
commit3ade772efd07fe342c10274b5fc6387965ac0c9d (patch)
treec4e686b67264f31e04a6378d93bb963ad9cb54f6
parent8c84f7ca274e5c8e4d249ede904bb247659dbce4 (diff)
downloadQt-3ade772efd07fe342c10274b5fc6387965ac0c9d.zip
Qt-3ade772efd07fe342c10274b5fc6387965ac0c9d.tar.gz
Qt-3ade772efd07fe342c10274b5fc6387965ac0c9d.tar.bz2
Another dynamic method autotest
-rw-r--r--tests/auto/declarative/qmlecmascript/data/MethodsObject.qml6
-rw-r--r--tests/auto/declarative/qmlecmascript/data/methods.4.qml11
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp9
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/MethodsObject.qml b/tests/auto/declarative/qmlecmascript/data/MethodsObject.qml
new file mode 100644
index 0000000..f51ca86
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/MethodsObject.qml
@@ -0,0 +1,6 @@
+import Qt 4.6
+
+QtObject {
+ function testFunction() { return 19; }
+ function testFunction2() { return 18; }
+}
diff --git a/tests/auto/declarative/qmlecmascript/data/methods.4.qml b/tests/auto/declarative/qmlecmascript/data/methods.4.qml
new file mode 100644
index 0000000..aac711c
--- /dev/null
+++ b/tests/auto/declarative/qmlecmascript/data/methods.4.qml
@@ -0,0 +1,11 @@
+import Qt 4.6
+
+MethodsObject {
+ function testFunction2() { return 17; }
+ function testFunction3() { return 16; }
+
+ property int test: testFunction()
+ property int test2: testFunction2()
+ property int test3: testFunction3()
+}
+
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index f560a90..6f7832a 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -206,6 +206,15 @@ void tst_qmlecmascript::methods()
QVERIFY(object != 0);
QCOMPARE(object->property("test").toInt(), 19);
}
+
+ {
+ QmlComponent component(&engine, TEST_FILE("methods.4.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ QCOMPARE(object->property("test").toInt(), 19);
+ QCOMPARE(object->property("test2").toInt(), 17);
+ QCOMPARE(object->property("test3").toInt(), 16);
+ }
}
void tst_qmlecmascript::bindingLoop()