Commit 303afae6 authored by Sandro Knauß's avatar Sandro Knauß
Browse files

fix tests(messagecomposer): be aware of a different way to sign&encrypt for OpenPGPMime.

parent cfa4e158
......@@ -171,7 +171,7 @@ void ComposerTestUtil::verifyEncryption(KMime::Content *content, const QByteArra
Q_UNUSED(encrContent);
}
void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment)
void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment, bool combind)
{
Q_UNUSED(withAttachment);
// store it in a KMime::Message, that's what OTP needs
......@@ -195,7 +195,13 @@ void ComposerTestUtil::verifySignatureAndEncryption(KMime::Content *content, con
QVector< KMime::Content * > extra = nh->extraContents(resultMessage.data());
QCOMPARE(extra.size(), 1);
QCOMPARE(nh->signatureState(extra[ 0 ]), MimeTreeParser::KMMsgFullySigned);
if (combind) {
QCOMPARE(nh->signatureState(resultMessage.data()), MimeTreeParser::KMMsgFullySigned);
} else {
QVector< KMime::Content * > extra = nh->extraContents(resultMessage.data());
QCOMPARE(extra.size(), 1);
QCOMPARE(nh->signatureState(extra[ 0 ]), MimeTreeParser::KMMsgFullySigned);
}
} else if (f & Kleo::InlineOpenPGPFormat) {
otp.parseObjectTree(resultMessage.data());
......
......@@ -49,7 +49,7 @@ void verifyEncryption(KMime::Content *content, const QByteArray &encrContent, Kl
/**
* Verifies that the given MIME content is signed and then encrypted, and the original text is as specified
*/
void verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment = false);
void verifySignatureAndEncryption(KMime::Content *content, const QByteArray &origContent, Kleo::CryptoMessageFormat f, bool withAttachment = false, bool combind = false);
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment