diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-05-19 13:06:46 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-05-19 13:11:39 (GMT) |
commit | 07e5f5f3b3b1936c5f5090b02cc2c02e344822b5 (patch) | |
tree | e9570f82488955fc677eaeae03dbde7594cb95db /tests/auto/qsslsocket | |
parent | 879d5cf234bb06657b67a39969ea16d68f79fbeb (diff) | |
download | Qt-07e5f5f3b3b1936c5f5090b02cc2c02e344822b5.zip Qt-07e5f5f3b3b1936c5f5090b02cc2c02e344822b5.tar.gz Qt-07e5f5f3b3b1936c5f5090b02cc2c02e344822b5.tar.bz2 |
Adpot more code to use QtNetworkSettings instead of hard coded names.
Reviewed-By: Peter Hartmann
Diffstat (limited to 'tests/auto/qsslsocket')
-rw-r--r-- | tests/auto/qsslsocket/tst_qsslsocket.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 3100dd5..5c99164 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -498,36 +498,39 @@ void tst_QSslSocket::sslErrors_data() { QTest::addColumn<QString>("host"); QTest::addColumn<int>("port"); - QTest::addColumn<SslErrorList>("errors"); - - QTest::newRow("imap.troll.no") << "imap.troll.no" << 993 - << (SslErrorList() - << QSslError::HostNameMismatch - << QSslError::SelfSignedCertificateInChain); - QTest::newRow("imap.trolltech.com") << "imap.trolltech.com" << 993 - << (SslErrorList() - << QSslError::SelfSignedCertificateInChain); + QTest::addColumn<SslErrorList>("expected"); + + QTest::newRow(qPrintable(QtNetworkSettings::serverLocalName())) + << QtNetworkSettings::serverLocalName() + << 993 + << (SslErrorList() << QSslError::HostNameMismatch + << QSslError::SelfSignedCertificate); + + QTest::newRow("imap.trolltech.com") + << "imap.trolltech.com" + << 993 + << (SslErrorList() << QSslError::SelfSignedCertificateInChain); } void tst_QSslSocket::sslErrors() { QFETCH(QString, host); QFETCH(int, port); - QFETCH(SslErrorList, errors); + QFETCH(SslErrorList, expected); QSslSocketPtr socket = newSocket(); socket->connectToHostEncrypted(host, port); socket->waitForEncrypted(5000); - SslErrorList list; + SslErrorList output; foreach (QSslError error, socket->sslErrors()) - list << error.error(); + output << error.error(); #ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND - if (list.last() == QSslError::CertificateUntrusted) - list.takeLast(); + if (output.last() == QSslError::CertificateUntrusted) + output.takeLast(); #endif - QCOMPARE(list, errors); + QCOMPARE(output, expected); } void tst_QSslSocket::addCaCertificate() |