diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-22 08:16:47 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-22 08:16:47 (GMT) |
commit | ba602c39e2ab7c16dcb212c935dbacdf053c6623 (patch) | |
tree | afefdb2249373860a370fb6b92800787d9842da8 /tests/auto | |
parent | 95e370e53e24cf4210bdea07022a7c4d94cd8854 (diff) | |
download | Qt-ba602c39e2ab7c16dcb212c935dbacdf053c6623.zip Qt-ba602c39e2ab7c16dcb212c935dbacdf053c6623.tar.gz Qt-ba602c39e2ab7c16dcb212c935dbacdf053c6623.tar.bz2 |
Fix test failures.
Also add a test for script errors within signal handlers.
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/data/scriptErrors.qml | 6 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml b/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml index 3fb8ff7..d39b312 100644 --- a/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml +++ b/tests/auto/declarative/qmlecmascript/data/scriptErrors.qml @@ -1,10 +1,12 @@ -import Qt 4.6 +import Qt.test 1.0 -Object { +MyQmlObject { Script { source: "scriptErrors.js" } Script { function getValue() { a = 10; return 0; } } property int x: a.value property int y: getValue(); + + onBasicSignal: { print(a.value); } } diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 34b49e6..a7a2ef6 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -760,12 +760,16 @@ void tst_qmlecmascript::scriptErrors() QString warning1 = url.left(url.length() - 3) + "js:2: Error: Invalid write to global property \"a\""; QString warning2 = url + ":7: TypeError: Result of expression 'a' [undefined] is not an object."; QString warning3 = url + ":5: Error: Invalid write to global property \"a\""; + QString warning4 = url + ":10: TypeError: Result of expression 'a' [undefined] is not an object."; QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData()); QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData()); QTest::ignoreMessage(QtWarningMsg, warning3.toLatin1().constData()); - QObject *object = component.create(); + MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create()); QVERIFY(object != 0); + + QTest::ignoreMessage(QtWarningMsg, warning4.toLatin1().constData()); + emit object->basicSignal(); } /* |