From 30b5e99da347aea446a5a3a334a21a4406adc4fe Mon Sep 17 00:00:00 2001 From: Luca Niccoli Date: Mon, 9 Mar 2015 19:20:26 +0100 Subject: Always initialize m_handshakeState The client-side constructor was leaving it uninitialized, which would sometimes lead to spurious error signals being emitted. Task-number: QTBUG-44893 Change-Id: I7a17f1a16d9a5fe4218beb6d92993c1889ad836b Reviewed-by: Oswald Buddenhagen Reviewed-by: Liang Qi --- tests/auto/qwebsocket/tst_qwebsocket.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/qwebsocket/tst_qwebsocket.cpp b/tests/auto/qwebsocket/tst_qwebsocket.cpp index 900f316..7659e89 100644 --- a/tests/auto/qwebsocket/tst_qwebsocket.cpp +++ b/tests/auto/qwebsocket/tst_qwebsocket.cpp @@ -410,6 +410,7 @@ void tst_QWebSocket::tst_sendTextMessage() QSignalSpy textFrameReceived(&socket, SIGNAL(textFrameReceived(QString,bool))); QSignalSpy binaryMessageReceived(&socket, SIGNAL(binaryMessageReceived(QByteArray))); QSignalSpy binaryFrameReceived(&socket, SIGNAL(binaryFrameReceived(QByteArray,bool))); + QSignalSpy socketError(&socket, SIGNAL(error(QAbstractSocket::SocketError))); QUrl url = QUrl(QStringLiteral("ws://") + echoServer.hostAddress().toString() + QStringLiteral(":") + QString::number(echoServer.port())); @@ -419,6 +420,7 @@ void tst_QWebSocket::tst_sendTextMessage() if (socketConnectedSpy.count() == 0) QVERIFY(socketConnectedSpy.wait(500)); + QCOMPARE(socketError.count(), 0); QCOMPARE(socket.state(), QAbstractSocket::ConnectedState); socket.sendTextMessage(QStringLiteral("Hello world!")); -- cgit v1.2.1