summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-08-13 22:08:49 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-08-25 03:45:36 +0000
commitc962f3c8e874f21743684a52ee520939ae1be938 (patch)
treede9a608f5d540df7d620190fe4b507febc7ec41c
parentbad007360a0f6fba304d8f4c99826a1250fd886c (diff)
downloadqtdeclarative-c962f3c8e874f21743684a52ee520939ae1be938.tar.gz
qtdeclarative-c962f3c8e874f21743684a52ee520939ae1be938.tar.bz2
qtdeclarative-c962f3c8e874f21743684a52ee520939ae1be938.zip
Fix autotest
The test was not getting a new warning as assumed, but still reading the old warning from a few lines before. This mirrors the intended behavior. Change-Id: I7211923e378db34cdc5f8c1c78f3cfb1bea548d2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index f4765d0e8..8ad2b6ba2 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -338,19 +338,17 @@ void tst_QQuickWorkerScript::script_global()
delete worker;
}
+ qquickworkerscript_lastWarning = QString();
+
{
+ QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
+
QQmlComponent component(&m_engine, testFileUrl("worker_global2.qml"));
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
QVERIFY(worker != 0);
- QString value("Hello");
-
- QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
-
- QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
-
QTRY_COMPARE(qquickworkerscript_lastWarning,
- testFileUrl("script_global.js").toString() + QLatin1String(":2: Invalid write to global property \"world\""));
+ testFileUrl("script_global2.js").toString() + QLatin1String(":1: Invalid write to global property \"world\""));
qInstallMessageHandler(previousMsgHandler);