summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2010-01-11 04:34:25 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2010-01-11 04:34:25 (GMT)
commitcf571ec8471d611c737e998e96b202eb118d29c8 (patch)
tree1d5f93536e96b3dc1e0a19c03cd6774e5a91dd6a /tests
parent39949590be794ec5d50a24b87c46d2771b67852b (diff)
downloadQt-cf571ec8471d611c737e998e96b202eb118d29c8.zip
Qt-cf571ec8471d611c737e998e96b202eb118d29c8.tar.gz
Qt-cf571ec8471d611c737e998e96b202eb118d29c8.tar.bz2
QTBUG-6507 appears fixed (don't know when)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml2
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp19
2 files changed, 17 insertions, 4 deletions
diff --git a/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml b/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml
index 44722a9..acc3163 100644
--- a/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml
+++ b/tests/auto/declarative/qmlecmascript/data/exceptionProducesWarning.qml
@@ -3,6 +3,6 @@ import Qt.test 1.0
MyQmlObject {
Component.onCompleted:
- { throw(123,"JS exception") }
+ { throw(new Error("JS exception")) }
}
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index 6f7832a..a153296 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -106,7 +106,8 @@ private slots:
void signalTriggeredBindings();
void listProperties();
void exceptionClearsOnReeval();
- void exceptionProducesWarning();
+ void exceptionSlotProducesWarning();
+ void exceptionBindingProducesWarning();
void transientErrors();
void shutdownErrors();
void externalScript();
@@ -933,12 +934,24 @@ void tst_qmlecmascript::exceptionClearsOnReeval()
QCOMPARE(object->property("test").toBool(), true);
}
-void tst_qmlecmascript::exceptionProducesWarning()
+void tst_qmlecmascript::exceptionSlotProducesWarning()
{
QmlComponent component(&engine, TEST_FILE("exceptionProducesWarning.qml"));
QString url = component.url().toString();
- QString warning = "Expected error - QTBUG-6507";
+ QString warning = component.url().toString() + ":6: Error: JS exception";
+
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+ MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());
+ QVERIFY(object != 0);
+}
+
+void tst_qmlecmascript::exceptionBindingProducesWarning()
+{
+ QmlComponent component(&engine, TEST_FILE("exceptionProducesWarning2.qml"));
+ QString url = component.url().toString();
+
+ QString warning = component.url().toString() + ":5: Error: JS exception";
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
MyQmlObject *object = qobject_cast<MyQmlObject*>(component.create());