From 0cd1ed0883e067edab24006b23fb1c663ba62041 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 17 Dec 2014 21:07:24 -0800 Subject: Fix running tst_qmessagehandler when QT_MESSAGE_PATTERN is set This test fails if the environment has the variable set. Change-Id: Ibd54ff3e6e22a885341898889088ac56e84282b1 Reviewed-by: David Faure Reviewed-by: Kai Koehne Reviewed-by: Olivier Goffart --- tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/auto/corelib') diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 749c7da789..68b1fef71d 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -40,6 +40,9 @@ class tst_qmessagehandler : public QObject { Q_OBJECT +public: + tst_qmessagehandler(); + public slots: void initTestCase(); @@ -92,6 +95,12 @@ void customMsgHandler(QtMsgType type, const char *msg) s_message = QString::fromLocal8Bit(msg); } +tst_qmessagehandler::tst_qmessagehandler() +{ + // ensure it's unset, otherwise we'll have trouble + qputenv("QT_MESSAGE_PATTERN", ""); +} + void tst_qmessagehandler::initTestCase() { m_appDir = QFINDTESTDATA("app"); -- cgit v1.2.3