From d4dc3159c7b8d80707f8f61e0c52bd4e4f97bd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= Date: Thu, 28 Aug 2014 12:12:03 +0200 Subject: Check certificate nullity instead of handle This changes tests which use QSslCertificate::handle() to determine if a certificate is null to use QSslCertificate::isNull() instead. This is required for non-OpenSSL backends which do not actually expose a private handle. Change-Id: I9523ba0dd00d47ba337b543ad34840125db99bfb Reviewed-by: Andrew Knight --- tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index e9a27cd83b..33cee37b92 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1027,17 +1027,17 @@ protected: if (m_interFile.isEmpty()) { QList localCert = QSslCertificate::fromPath(m_certFile); QVERIFY(!localCert.isEmpty()); - QVERIFY(localCert.first().handle()); + QVERIFY(!localCert.first().isNull()); socket->setLocalCertificate(localCert.first()); } else { QList localCert = QSslCertificate::fromPath(m_certFile); QVERIFY(!localCert.isEmpty()); - QVERIFY(localCert.first().handle()); + QVERIFY(!localCert.first().isNull()); QList interCert = QSslCertificate::fromPath(m_interFile); QVERIFY(!interCert.isEmpty()); - QVERIFY(interCert.first().handle()); + QVERIFY(!interCert.first().isNull()); socket->setLocalCertificateChain(localCert + interCert); } @@ -1527,7 +1527,7 @@ protected: // Only set the certificate QList localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert"); QVERIFY(!localCert.isEmpty()); - QVERIFY(localCert.first().handle()); + QVERIFY(!localCert.first().isNull()); socket->setLocalCertificate(localCert.first()); QVERIFY(socket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState)); @@ -1762,7 +1762,7 @@ protected: QList localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert"); QVERIFY(!localCert.isEmpty()); - QVERIFY(localCert.first().handle()); + QVERIFY(!localCert.first().isNull()); socket->setLocalCertificate(localCert.first()); QVERIFY(socket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState)); @@ -2458,7 +2458,7 @@ void WebSocket::_startServerEncryption (void) QList localCert = QSslCertificate::fromPath(m_certFile); QVERIFY(!localCert.isEmpty()); - QVERIFY(localCert.first().handle()); + QVERIFY(!localCert.first().isNull()); setLocalCertificate(localCert.first()); QVERIFY(!peerAddress().isNull()); @@ -2638,7 +2638,7 @@ void tst_QSslSocket::qtbug18498_peek2() QList localCert = QSslCertificate::fromPath(SRCDIR "certs/fluke.cert"); QVERIFY(!localCert.isEmpty()); - QVERIFY(localCert.first().handle()); + QVERIFY(!localCert.first().isNull()); server->setLocalCertificate(localCert.first()); server->setProtocol(QSsl::AnyProtocol); -- cgit v1.2.3