summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-01-18 15:01:14 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-01-18 15:27:58 (GMT)
commit102f415e39772086e9066f2e9954c0c22725a23e (patch)
treee5b3a42fb2bebf48a783543ebf8737eeee41a4b8 /tests
parent74a3dc292d3e48e74836fb953fe793b65e652c54 (diff)
downloadQt-102f415e39772086e9066f2e9954c0c22725a23e.zip
Qt-102f415e39772086e9066f2e9954c0c22725a23e.tar.gz
Qt-102f415e39772086e9066f2e9954c0c22725a23e.tar.bz2
Fix QSslCertificate issues
Thank you Matthew Cattell for the fix! Task-number: QTBUG-6466 Reviewed-by: joao
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qsslcertificate/tst_qsslcertificate.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
index 892d745..44f8522 100644
--- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
@@ -105,6 +105,7 @@ private slots:
void fromPath_data();
void fromPath();
void certInfo();
+ void certInfoQByteArray();
void task256066toPem();
void nulInCN();
void nulInSan();
@@ -697,6 +698,18 @@ void tst_QSslCertificate::certInfo()
QCOMPARE(cert, QSslCertificate(QByteArray::fromHex(der), QSsl::Der));
}
+void tst_QSslCertificate::certInfoQByteArray()
+{
+ QSslCertificate cert = QSslCertificate::fromPath("certificates/cert.pem", QSsl::Pem,
+ QRegExp::FixedString).first();
+ QVERIFY(!cert.isNull());
+
+ // in this test, check the bytearray variants before the enum variants to see if
+ // we fixed a bug we had with lazy initialization of the values.
+ QCOMPARE(cert.issuerInfo("CN"), QString("Test CA (1024 bit)"));
+ QCOMPARE(cert.subjectInfo("CN"), QString("name/with/slashes"));
+}
+
void tst_QSslCertificate::task256066toPem()
{
// a certificate whose PEM encoding's length is a multiple of 64