summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/graphicsview
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2011-12-30 10:58:14 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-30 04:14:53 +0100
commit14e139f39187a6e87d6eed332b11b8a3f8521906 (patch)
tree96edfd9df01ce3421a376c077d02dbef2edd17cf /tests/auto/widgets/graphicsview
parentd8f1749a7472ce924304d45cdd94f8488b1e65fd (diff)
Prevent qDebug test bypassing the testlib message handler.
Several of the test functions in the QDebug autotest call qInstallMsgHandler() to temporarily use a custom message handler. Unfortunately, these test functions were then resetting the message handler back to Qt's default handler at the end of the test. QTestLib also calls qInstallMsgHandler() to set a message handler that redirects debug/warning/fatal messages into the test log. When the test resets the message handler back to Qt's default handler, testlib's message handler is bypassed for the rest of the test, preventing any subsequent debug/warning/fatal messages from being visible in the test log or subject to testlib's ignoreMessage() function. This error also caused several of the test functions to fail if they were run manually. The "defaultMessagehandler" test would fail if it was run before any other test function and the "assignment" test would fail if it was run after any other test function. This commit fixes these failures by using a helper class to ensure that the previously active message handler is restored at the end of each test function, even if the test function fails or throws an exception. Change-Id: I51376724d164c8ad126e5b9be76890bf3e6a9fb0 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/widgets/graphicsview')
0 files changed, 0 insertions, 0 deletions