tst_QLocalSocket: Only expect debug messages if debug level is enabled

Otherwise the ::debug() test fails when a build does not print qDebug()
messages.

Change-Id: I3f3c4b3c7d74004abe5ed8d7ac52164d4f88ef1f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Kari Oikarinen 2018-02-26 10:27:16 +02:00
parent f22ae9c0d0
commit be674bcdc5
1 changed files with 2 additions and 1 deletions

View File

@ -1193,7 +1193,8 @@ void tst_QLocalSocket::writeToClientAndDisconnect()
void tst_QLocalSocket::debug()
{
// Make sure this compiles
QTest::ignoreMessage(QtDebugMsg, "QLocalSocket::ConnectionRefusedError QLocalSocket::UnconnectedState");
if (QLoggingCategory::defaultCategory()->isDebugEnabled())
QTest::ignoreMessage(QtDebugMsg, "QLocalSocket::ConnectionRefusedError QLocalSocket::UnconnectedState");
qDebug() << QLocalSocket::ConnectionRefusedError << QLocalSocket::UnconnectedState;
}