Go to file
Jason McDonald 14e139f391 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>
2011-12-30 04:14:53 +01:00
bin fixqt4headers: Add QtCore to folders (for moved item models). 2011-12-20 16:18:27 +01:00
config.tests Fix fvisibility.test for "QMAKE_CXX = ccache g++" 2011-12-18 19:12:42 +01:00
dist Retire QTest::pixmapsAreEqual(). 2011-12-20 06:17:42 +01:00
doc/src Move snippets from qtdoc. 2011-12-06 22:29:01 +01:00
examples Added multi-screen support to hellowindow example. 2011-12-06 20:14:10 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Fix cmake files for static builds. 2011-12-23 17:35:33 +01:00
qmake Remove unused -DQT_NO_PCRE from qmake makefiles 2011-12-23 21:24:25 +01:00
src Make qDecodeDataUrl return bool. 2011-12-29 16:20:45 +01:00
tests Prevent qDebug test bypassing the testlib message handler. 2011-12-30 04:14:53 +01:00
tools Finish removing Qt3 support 2011-12-23 11:59:11 +01:00
util Fix up the accessibility inspector. 2011-12-22 00:47:03 +01:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Add V8 snapshot support 2011-11-22 13:10:56 +01:00
.gitmodules Add QtV8 library to QtBase 2011-08-29 10:16:01 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Finish removing Qt3 support 2011-12-23 11:59:11 +01:00
configure.exe Rebuild configure.exe. 2011-12-21 22:58:56 +01:00
header.BSD Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
header.FDL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL-ONLY Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
INSTALL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Ensure qmodule.pri is installed. 2011-11-23 00:12:03 +01:00
sync.profile Fix source incompatibility for QVariant{Map, Hash, List} 2011-11-14 18:41:17 +01:00