diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2012-09-13 14:47:47 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-14 14:51:39 +0200 |
commit | aa6d27f043f0367ea4c16bb255f65b2a6abb5921 (patch) | |
tree | 663c468830121f3cd3abc8a85a9cae3a2b7a8311 /tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp | |
parent | cf5b6c3ef72df623117678de01fd5557861ba73b (diff) |
Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5.
Change-Id: I87f5f8d5b28afcbcf8a9c613d1d4b1199f5f4254
Reviewed-by: Martin Jones <martin.r.jones@gmail.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp index b11564cd..209da67f 100644 --- a/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp +++ b/tests/auto/declarative/qdeclarativeworkerscript/tst_qdeclarativeworkerscript.cpp @@ -234,24 +234,24 @@ void tst_QDeclarativeWorkerScript::script_included() } static QString qdeclarativeworkerscript_lastWarning; -static void qdeclarativeworkerscript_warningsHandler(QtMsgType type, const char *msg) +static void qdeclarativeworkerscript_warningsHandler(QtMsgType type, const QMessageLogContext &, const QString &msg) { if (type == QtWarningMsg) - qdeclarativeworkerscript_lastWarning = QString::fromUtf8(msg); + qdeclarativeworkerscript_lastWarning = msg; } void tst_QDeclarativeWorkerScript::scriptError_onLoad() { QDeclarativeComponent component(&m_engine, testFileUrl("worker_error_onLoad.qml")); - QtMsgHandler previousMsgHandler = qInstallMsgHandler(qdeclarativeworkerscript_warningsHandler); + QtMessageHandler previousMsgHandler = qInstallMessageHandler(qdeclarativeworkerscript_warningsHandler); QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create()); QVERIFY(worker != 0); QTRY_COMPARE(qdeclarativeworkerscript_lastWarning, testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3: SyntaxError: Parse error")); - qInstallMsgHandler(previousMsgHandler); + qInstallMessageHandler(previousMsgHandler); qApp->processEvents(); delete worker; } @@ -262,14 +262,14 @@ void tst_QDeclarativeWorkerScript::scriptError_onCall() QDeclarativeWorkerScript *worker = qobject_cast<QDeclarativeWorkerScript*>(component.create()); QVERIFY(worker != 0); - QtMsgHandler previousMsgHandler = qInstallMsgHandler(qdeclarativeworkerscript_warningsHandler); + QtMessageHandler previousMsgHandler = qInstallMessageHandler(qdeclarativeworkerscript_warningsHandler); QVariant value; QVERIFY(QMetaObject::invokeMethod(worker, "testSend", Q_ARG(QVariant, value))); QTRY_COMPARE(qdeclarativeworkerscript_lastWarning, testFileUrl("script_error_onCall.js").toString() + QLatin1String(":4: ReferenceError: Can't find variable: getData")); - qInstallMsgHandler(previousMsgHandler); + qInstallMessageHandler(previousMsgHandler); qApp->processEvents(); delete worker; } |