14e139f391
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> |
||
---|---|---|
.. | ||
qabstractfileengine | ||
qbuffer | ||
qdatastream | ||
qdebug | ||
qdir | ||
qdiriterator | ||
qfile | ||
qfileinfo | ||
qfilesystementry | ||
qfilesystemwatcher | ||
qiodevice | ||
qprocess | ||
qprocessenvironment | ||
qresourceengine | ||
qsettings | ||
qstandardpaths | ||
qtemporarydir | ||
qtemporaryfile | ||
qtextstream | ||
qurl | ||
io.pro |