diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2012-09-12 10:42:25 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-14 15:23:15 +0200 |
commit | 1dd4790aeef17f056840bfea6c438075adbaaa03 (patch) | |
tree | 736429b2f1a1cfa31c2ab739dc51da51c0867b20 /tests/auto/other/exceptionsafety_objects | |
parent | 14f7eb86ca2275d91f284279af5f77205d4ae3c0 (diff) |
Autotests: Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5.
Change-Id: Ib36983e66b3a8090b99f14e3fd4e210602a3f018
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/other/exceptionsafety_objects')
-rw-r--r-- | tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp index 126b41ed51..d779ac7eae 100644 --- a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp +++ b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp @@ -79,8 +79,8 @@ private slots: void linkedList(); private: - static QtMsgHandler testMessageHandler; - static void safeMessageHandler(QtMsgType, const char *); + static QtMessageHandler testMessageHandler; + static void safeMessageHandler(QtMsgType, const QMessageLogContext&, const QString&); #endif }; @@ -275,15 +275,16 @@ public: } }; -QtMsgHandler tst_ExceptionSafety_Objects::testMessageHandler; +QtMessageHandler tst_ExceptionSafety_Objects::testMessageHandler; -void tst_ExceptionSafety_Objects::safeMessageHandler(QtMsgType type, const char *msg) +void tst_ExceptionSafety_Objects::safeMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, + const QString &msg) { // this temporarily suspends OOM testing while handling a message int currentIndex = mallocFailIndex; AllocFailer allocFailer(0); allocFailer.deactivate(); - (*testMessageHandler)(type, msg); + (*testMessageHandler)(type, ctxt, msg); allocFailer.reactivateAt(currentIndex); } @@ -307,7 +308,7 @@ void tst_ExceptionSafety_Objects::initTestCase() // set handlers for bad exception cases, you might want to step in and breakpoint the default handlers too defaultTerminate = std::set_terminate(&debugTerminate); defaultUnexpected = std::set_unexpected(&debugUnexpected); - testMessageHandler = qInstallMsgHandler(safeMessageHandler); + testMessageHandler = qInstallMessageHandler(safeMessageHandler); QVERIFY(AllocFailer::initialize()); @@ -342,7 +343,7 @@ void tst_ExceptionSafety_Objects::initTestCase() void tst_ExceptionSafety_Objects::cleanupTestCase() { - qInstallMsgHandler(testMessageHandler); + qInstallMessageHandler(testMessageHandler); } void tst_ExceptionSafety_Objects::objects() |