summaryrefslogtreecommitdiff
path: root/tests/auto/qscriptengine/tst_qscriptengine.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-09-13 15:38:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-14 09:31:48 +0200
commit473cadd4a4764d31d64a0d1e004d618a5ae3392c (patch)
tree9a35ef35300984103737e6c9813751931a312b2f /tests/auto/qscriptengine/tst_qscriptengine.cpp
parent21d19a3db08ec179feed6b358ca21bb3ba94fac4 (diff)
downloadqtscript-473cadd4a4764d31d64a0d1e004d618a5ae3392c.tar.gz
Tests: Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5. Change-Id: I4da748659f232d8b0fe4b16fe9cf83290762dd2c Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests/auto/qscriptengine/tst_qscriptengine.cpp')
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 6d77b32..19a8e79 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -3653,10 +3653,10 @@ void tst_QScriptEngine::isEvaluating_fromEvent()
static QtMsgType theMessageType;
static QString theMessage;
-static void myMsgHandler(QtMsgType type, const char *msg)
+static void myMsgHandler(QtMsgType type, const QMessageLogContext &, const QString &msg)
{
theMessageType = type;
- theMessage = QString::fromLatin1(msg);
+ theMessage = msg;
}
void tst_QScriptEngine::printFunctionWithCustomHandler()
@@ -3666,7 +3666,7 @@ void tst_QScriptEngine::printFunctionWithCustomHandler()
// redirected without changing the print() function itself.
// This behavior is not documented.
QScriptEngine eng;
- QtMsgHandler oldHandler = qInstallMsgHandler(myMsgHandler);
+ QtMessageHandler oldHandler = qInstallMessageHandler(myMsgHandler);
QVERIFY(eng.globalObject().property("print").isFunction());
theMessageType = QtSystemMsg;
@@ -3681,7 +3681,7 @@ void tst_QScriptEngine::printFunctionWithCustomHandler()
QCOMPARE(theMessageType, QtDebugMsg);
QCOMPARE(theMessage, QString::fromLatin1("3 true little pigs"));
- qInstallMsgHandler(oldHandler);
+ qInstallMessageHandler(oldHandler);
}
void tst_QScriptEngine::printThrowsException()