aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-09-13 14:35:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-14 14:51:47 +0200
commit08444bab1bf25e20837ea47b647a5b1216caa05c (patch)
tree65fc2e90bbf29f22a92deb322bd4a9de939e8e17 /tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
parent75b9cd92dc5291ce12d8d609c5d721246044ffa0 (diff)
Autotests: Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5. Change-Id: Icb6423c7d9f7e507ba36376b0af5ad183379c494 Reviewed-by: Martin Jones <martin.r.jones@gmail.com>
Diffstat (limited to 'tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp')
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 2eadc461cf..ae2e0301a5 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -242,24 +242,24 @@ void tst_QQuickWorkerScript::script_included()
}
static QString qquickworkerscript_lastWarning;
-static void qquickworkerscript_warningsHandler(QtMsgType type, const char *msg)
+static void qquickworkerscript_warningsHandler(QtMsgType type, const QMessageLogContext &, const QString &msg)
{
if (type == QtWarningMsg)
- qquickworkerscript_lastWarning = QString::fromUtf8(msg);
+ qquickworkerscript_lastWarning = msg;
}
void tst_QQuickWorkerScript::scriptError_onLoad()
{
QQmlComponent component(&m_engine, testFileUrl("worker_error_onLoad.qml"));
- QtMsgHandler previousMsgHandler = qInstallMsgHandler(qquickworkerscript_warningsHandler);
+ QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
QVERIFY(worker != 0);
QTRY_COMPARE(qquickworkerscript_lastWarning,
testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3: SyntaxError: Unexpected identifier"));
- qInstallMsgHandler(previousMsgHandler);
+ qInstallMessageHandler(previousMsgHandler);
qApp->processEvents();
delete worker;
}
@@ -270,14 +270,14 @@ void tst_QQuickWorkerScript::scriptError_onCall()
QQuickWorkerScript *worker = qobject_cast<QQuickWorkerScript*>(component.create());
QVERIFY(worker != 0);
- QtMsgHandler previousMsgHandler = qInstallMsgHandler(qquickworkerscript_warningsHandler);
+ QtMessageHandler previousMsgHandler = qInstallMessageHandler(qquickworkerscript_warningsHandler);
QVariant value;
QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value)));
QTRY_COMPARE(qquickworkerscript_lastWarning,
testFileUrl("script_error_onCall.js").toString() + QLatin1String(":4: ReferenceError: getData is not defined"));
- qInstallMsgHandler(previousMsgHandler);
+ qInstallMessageHandler(previousMsgHandler);
qApp->processEvents();
delete worker;
}