summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2014-08-28 12:12:03 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2014-08-28 13:33:46 +0200
commitd4dc3159c7b8d80707f8f61e0c52bd4e4f97bd49 (patch)
treee02e9fc36f5fe8d12174453f0c55bcc878ecb322 /tests/auto
parent4354fef3d4c45a9ac1c01cf99627aad6d3b4d68d (diff)
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 <andrew.knight@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp14
1 files changed, 7 insertions, 7 deletions
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<QSslCertificate> localCert = QSslCertificate::fromPath(m_certFile);
QVERIFY(!localCert.isEmpty());
- QVERIFY(localCert.first().handle());
+ QVERIFY(!localCert.first().isNull());
socket->setLocalCertificate(localCert.first());
}
else {
QList<QSslCertificate> localCert = QSslCertificate::fromPath(m_certFile);
QVERIFY(!localCert.isEmpty());
- QVERIFY(localCert.first().handle());
+ QVERIFY(!localCert.first().isNull());
QList<QSslCertificate> 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<QSslCertificate> 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<QSslCertificate> 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<QSslCertificate> 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<QSslCertificate> 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);