summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-01-28 16:04:03 +0100
committerKai Koehne <kai.koehne@theqtcompany.com>2015-01-30 07:28:43 +0000
commitaa0e97f08a4266906d97c26cc1ba05686b1cd72e (patch)
tree5cc12a9dbfedbd10787c937ba05ef91e656f9241 /tests
parent8fccd6767be00248d0dcf70c7335a6c587853d23 (diff)
Fix testBrokenJSMethodConnect autotest
Since qtdeclarative change e2c1e7b8a exceptions in JS slots do _not_ set the engine to an error state anymore, but are rather printed to console, and ignored. This prevents exceptions to silently propagate ... Change-Id: Icb065314730cf2142eedbde14b0c77c21bdd6f6f Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/installer/scriptengine/data/broken_connect.qs2
-rw-r--r--tests/auto/installer/scriptengine/tst_scriptengine.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/installer/scriptengine/data/broken_connect.qs b/tests/auto/installer/scriptengine/data/broken_connect.qs
index 2fe873b63..9c7c2b864 100644
--- a/tests/auto/installer/scriptengine/data/broken_connect.qs
+++ b/tests/auto/installer/scriptengine/data/broken_connect.qs
@@ -6,6 +6,6 @@ function BrokenConnect()
function receive()
{
print("function receive()");
- // this should throw an exception, "foo" does not exist
+ // this will print an error.
foo.bar = "test";
}
diff --git a/tests/auto/installer/scriptengine/tst_scriptengine.cpp b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
index 09785850e..0da511581 100644
--- a/tests/auto/installer/scriptengine/tst_scriptengine.cpp
+++ b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
@@ -232,6 +232,9 @@ private slots:
void testBrokenJSMethodConnect()
{
+#if QT_VERSION <= 0x50400
+ QSKIP("Behavior changed from 5.4.1 onwards");
+#endif
EmitSignalObject emiter;
m_scriptEngine->globalObject().setProperty(QLatin1String("emiter"),
m_scriptEngine->newQObject(&emiter));
@@ -248,11 +251,11 @@ private slots:
// ignore Output from script
setExpectedScriptOutput("\"function receive()\"");
+ QTest::ignoreMessage(QtWarningMsg, ":10: ReferenceError: foo is not defined");
emiter.produceSignal();
const QJSValue value = m_scriptEngine->evaluate("");
- QCOMPARE(value.isError(), true);
- QCOMPARE(value.toString(), QLatin1String("ReferenceError: foo is not defined"));
+ QCOMPARE(value.isError(), false);
}
void testScriptPrint()