summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDamien Caliste <dcaliste@free.fr>2024-04-03 13:45:50 +0200
committerDamien Caliste <dcaliste@free.fr>2024-04-10 14:14:28 +0200
commitf4459420b72bbd005886d67fba4fb34da2958b5e (patch)
tree6ad52840d24cd787a9caeaada892bda02b79cd92 /tests
parentd18952aa8def7d2087f1ef18701adf8c5cbac2ca (diff)
Adjust crypto sign() API
Make sign() API to operate on a pointer on a part, instead of a reference, to emphasis the fact that it will change the part itself, making it a multipart/signed container. Change-Id: I55a1e2d15ee170909ae4aa8f2c0e8f8e88c9134c Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/tst_crypto/tst_crypto.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/tst_crypto/tst_crypto.cpp b/tests/tst_crypto/tst_crypto.cpp
index d6bf3c9b..f36aa074 100644
--- a/tests/tst_crypto/tst_crypto.cpp
+++ b/tests/tst_crypto/tst_crypto.cpp
@@ -384,7 +384,7 @@ void tst_Crypto::sign()
// Check message signing.
QMailMessage msg = QMailMessage::fromRfc2822File(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(),
rfc2822Filename));
- QCOMPARE(QMailCryptographicServiceFactory::sign(msg, plugin, QStringList(fingerprint), passphrase), expectedStatus);
+ QCOMPARE(QMailCryptographicServiceFactory::sign(&msg, plugin, QStringList(fingerprint), passphrase), expectedStatus);
// Check signed message output.
// Replace the random boundary strings with a fixed one for comparison.
@@ -413,7 +413,7 @@ void tst_Crypto::signVerify()
message.setBody(QMailMessageBody::fromData("test", type, QMailMessageBody::Base64));
// Sign it with the PGP key (no password).
- QMailCryptoFwd::SignatureResult r = QMailCryptographicServiceFactory::sign(message, "libgpgme.so", QStringList() << m_pgpKey);
+ QMailCryptoFwd::SignatureResult r = QMailCryptographicServiceFactory::sign(&message, "libgpgme.so", QStringList() << m_pgpKey);
QCOMPARE(r, QMailCryptoFwd::SignatureValid);
QCOMPARE(message.partCount(), uint(2));
QCOMPARE(message.contentType().type(), QByteArray("multipart"));