diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2010-01-18 16:01:14 +0100 |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2010-01-18 16:27:58 +0100 |
commit | 102f415e39772086e9066f2e9954c0c22725a23e (patch) | |
tree | e5b3a42fb2bebf48a783543ebf8737eeee41a4b8 /tests/auto/qsslcertificate/tst_qsslcertificate.cpp | |
parent | 74a3dc292d3e48e74836fb953fe793b65e652c54 (diff) | |
download | qt4-tools-102f415e39772086e9066f2e9954c0c22725a23e.tar.gz |
Fix QSslCertificate issues
Thank you Matthew Cattell for the fix!
Task-number: QTBUG-6466
Reviewed-by: joao
Diffstat (limited to 'tests/auto/qsslcertificate/tst_qsslcertificate.cpp')
-rw-r--r-- | tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 892d7452eb..44f85224c6 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 |