summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsslsocket
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-05-19 13:06:46 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-05-19 13:09:27 (GMT)
commit70429c33f0687afd489e1055bc0e1f1f340e13b9 (patch)
tree4917de9c58c45bab4d7561a560cc11c469a6ff98 /tests/auto/qsslsocket
parentac70ce3f2598f0f3aae64c2e39c580375fd62df0 (diff)
downloadQt-70429c33f0687afd489e1055bc0e1f1f340e13b9.zip
Qt-70429c33f0687afd489e1055bc0e1f1f340e13b9.tar.gz
Qt-70429c33f0687afd489e1055bc0e1f1f340e13b9.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.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp
index 79fbf1b..d87ab7b 100644
--- a/tests/auto/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp
@@ -499,36 +499,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()