summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-10-19 11:14:55 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-10-19 12:38:28 +0000
commit240d768ca6ef41bf661a1fb8e1bde408e25ba553 (patch)
tree0ea2483a76b80ce25f21bc421f29513a301dceaf /tests/auto/network/ssl
parent733ac31cccc6ef9e0f1180f3aa4aa4f7db3fe65d (diff)
tests/auto/network: Remove some placeholder formatting.
Use QByteArray/QString addition instead in loops and for test row names. Change-Id: I7974ace5b34f2da43e7511044e80de1e733245ac Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests/auto/network/ssl')
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp10
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp14
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index 0c217195a0..4ebaedd8de 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -423,15 +423,15 @@ void tst_QSslCertificate::subjectAlternativeNames()
QMapIterator<QSsl::AlternativeNameEntryType, QString> it(altSubjectNames);
while (it.hasNext()) {
it.next();
- QString type;
+ QByteArray type;
if (it.key() == QSsl::EmailEntry)
- type = QLatin1String("email");
+ type = "email";
else if (it.key() == QSsl::DnsEntry)
- type = QLatin1String("DNS");
+ type = "DNS";
else
QFAIL("unsupported alternative name type");
- QString entry = QString("%1:%2").arg(type).arg(it.value());
- QVERIFY(fileContents.contains(entry.toLatin1()));
+ const QByteArray entry = type + ':' + it.value().toLatin1();
+ QVERIFY(fileContents.contains(entry));
}
// verify that each entry in fileContents is present in subjAltNames
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index a7957d3288..81257a460f 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -279,13 +279,13 @@ void tst_QSslKey::toEncryptedPemOrDer_data()
<< "aAzZ`1234567890-=~!@#$%^&*()_+[]{}\\|;:'\",.<>/?"; // ### add more (?)
foreach (KeyInfo keyInfo, keyInfoList) {
foreach (QString password, passwords) {
- QString testName = QString("%1-%2-%3-%4-%5").arg(keyInfo.fileInfo.fileName())
- .arg(keyInfo.algorithm == QSsl::Rsa ? "RSA" :
- (keyInfo.algorithm == QSsl::Dsa ? "DSA" : "EC"))
- .arg(keyInfo.type == QSsl::PrivateKey ? "PrivateKey" : "PublicKey")
- .arg(keyInfo.format == QSsl::Pem ? "PEM" : "DER")
- .arg(password);
- QTest::newRow(testName.toLatin1())
+ const QByteArray testName = keyInfo.fileInfo.fileName().toLatin1()
+ + '-' + (keyInfo.algorithm == QSsl::Rsa ? "RSA" :
+ (keyInfo.algorithm == QSsl::Dsa ? "DSA" : "EC"))
+ + '-' + (keyInfo.type == QSsl::PrivateKey ? "PrivateKey" : "PublicKey")
+ + '-' + (keyInfo.format == QSsl::Pem ? "PEM" : "DER")
+ + password.toLatin1();
+ QTest::newRow(testName.constData())
<< keyInfo.fileInfo.absoluteFilePath() << keyInfo.algorithm << keyInfo.type
<< keyInfo.format << password;
}