summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-01-11 02:08:08 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-01-11 02:08:08 (GMT)
commitbdd8c96fd99556318c78a5ed4b877440ef396935 (patch)
treefb20b42b222bc038b86735b2b519e317f7887d7d /tests
parentba6816d194423d220ba34a5e0b57aa5b97af942c (diff)
parente1dfba9da8e093255c6020cb61b1b0ea68d2c012 (diff)
downloadQt-bdd8c96fd99556318c78a5ed4b877440ef396935.zip
Qt-bdd8c96fd99556318c78a5ed4b877440ef396935.tar.gz
Qt-bdd8c96fd99556318c78a5ed4b877440ef396935.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests')
-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
-rw-r--r--tests/benchmarks/declarative/script/tst_script.cpp4
4 files changed, 28 insertions, 2 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()
diff --git a/tests/benchmarks/declarative/script/tst_script.cpp b/tests/benchmarks/declarative/script/tst_script.cpp
index 3c0805a..f417d0c 100644
--- a/tests/benchmarks/declarative/script/tst_script.cpp
+++ b/tests/benchmarks/declarative/script/tst_script.cpp
@@ -157,10 +157,10 @@ void tst_script::property_js()
}
}
-static QScriptValue property_getter_method(QScriptContext *, QScriptEngine *)
+static QScriptValue property_getter_method(QScriptContext *, QScriptEngine *engine)
{
static int x = 0;
- return QScriptValue(x++);
+ return QScriptValue(engine,x++);
}
void tst_script::property_getter()