From 14d1097f4577edab86c67090d5c20853f404d0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= Date: Fri, 12 Dec 2014 15:46:02 +0100 Subject: [PATCH] ssl: store socket in setEmptyDefaultConfiguration The setEmptyDefaultConfiguration test creates a socket and connects its sslErrors signal to tst_QSslSocket's ignoreErrorSlot slot. This slot expects the socket to have been stored in tst_QsslSocket's "socket" member, which was not being done. This patch fixes this problem. It does beg the question of whether having a "socket" member in the tst_QSslSocket class is a good idea as it is error prone. Change-Id: Ic59d1789c5f1ed240c3f0c37981f6ecc35572f0d Reviewed-by: Richard J. Moore --- tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index dcd33d6984..868a6119a8 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -2752,8 +2752,10 @@ void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last, QSslConfiguration emptyConf; QSslConfiguration::setDefaultConfiguration(emptyConf); - QSslSocketPtr socket = newSocket(); - connect(socket.data(), SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); + QSslSocketPtr client = newSocket(); + socket = client.data(); + + connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443); QFETCH_GLOBAL(bool, setProxy); if (setProxy && socket->waitForEncrypted(4000))