From bfc5bb09c4b79c17e1d846f6c46611d83cc7de4a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 7 Jul 2013 16:00:43 -0700 Subject: Ignore or suppress warning and debug messages in tst_QLocalSocket The one in tst_QLocalSocket::writeToClientAndDisconnect just needed proper ordering: that's what waitForDisconnect is for. At the same time, we need to make sure we get the same message from all three implementations of QLocalSocket::waitForDisconnect (and without the useless space at the end). Change-Id: I21364263cf908df022df814a6a39fcb5783e84e6 Reviewed-by: Shane Kearns --- tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/auto/network') diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp index 7065f5be36..9887acf7dd 100644 --- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp @@ -270,6 +270,7 @@ void tst_QLocalSocket::socket_basic() //QCOMPARE(socket.socketDescriptor(), (qintptr)-1); QCOMPARE(socket.state(), QLocalSocket::UnconnectedState); QCOMPARE(socket.waitForConnected(0), false); + QTest::ignoreMessage(QtWarningMsg, "QLocalSocket::waitForDisconnected() is not allowed in UnconnectedState"); QCOMPARE(socket.waitForDisconnected(0), false); QCOMPARE(socket.waitForReadyRead(0), false); @@ -313,6 +314,7 @@ void tst_QLocalSocket::listen() QVERIFY(server.errorString().isEmpty()); QCOMPARE(server.serverError(), QAbstractSocket::UnknownSocketError); // already isListening + QTest::ignoreMessage(QtWarningMsg, "QLocalServer::listen() called when already listening"); QVERIFY(!server.listen(name)); } else { QVERIFY(!server.errorString().isEmpty()); @@ -1015,15 +1017,16 @@ void tst_QLocalSocket::writeToClientAndDisconnect() clientSocket->close(); server.close(); - QTRY_COMPARE(readChannelFinishedSpy.count(), 1); - QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer)); client.waitForDisconnected(); + QCOMPARE(readChannelFinishedSpy.count(), 1); + QCOMPARE(client.read(buffer, sizeof(buffer)), (qint64)sizeof(buffer)); QCOMPARE(client.state(), QLocalSocket::UnconnectedState); } void tst_QLocalSocket::debug() { // Make sure this compiles + QTest::ignoreMessage(QtDebugMsg, "QLocalSocket::ConnectionRefusedError QLocalSocket::UnconnectedState "); qDebug() << QLocalSocket::ConnectionRefusedError << QLocalSocket::UnconnectedState; } @@ -1155,7 +1158,7 @@ void tst_QLocalSocket::verifyListenWithDescriptor() QFETCH(bool, abstract); QFETCH(bool, bound); - qDebug() << "socket" << path << abstract; +// qDebug() << "socket" << path << abstract; int listenSocket; -- cgit v1.2.3