From 37983d97ec0eb03845f11eb03f429174acfd327b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Jun 2017 00:27:24 +0200 Subject: A simplistic security border Still a bit obnoxious and doesn't really convey a whole lot of information. Consider it a stub for now --- framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp') diff --git a/framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp b/framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp index 74f12eec..f9b557c9 100644 --- a/framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp +++ b/framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp @@ -125,16 +125,22 @@ private slots: QCOMPARE(part->charset(), QStringLiteral("us-ascii").toLocal8Bit()); QCOMPARE(part->encryptions().size(), 1); QCOMPARE(part->signatures().size(), 1); + QCOMPARE(part->encryptionState(), MimeTreeParser::KMMsgFullyEncrypted); + QCOMPARE(part->signatureState(), MimeTreeParser::KMMsgFullySigned); auto contentAttachmentList = otp.collectAttachmentParts(); QCOMPARE(contentAttachmentList.size(), 2); // QCOMPARE(contentAttachmentList[0]->availableContents(), QVector() << "text/plain"); // QCOMPARE(contentAttachmentList[0]->content().size(), 1); QCOMPARE(contentAttachmentList[0]->encryptions().size(), 1); QCOMPARE(contentAttachmentList[0]->signatures().size(), 1); + QCOMPARE(contentAttachmentList[0]->encryptionState(), MimeTreeParser::KMMsgFullyEncrypted); + QCOMPARE(contentAttachmentList[0]->signatureState(), MimeTreeParser::KMMsgFullySigned); // QCOMPARE(contentAttachmentList[1]->availableContents(), QVector() << "image/png"); // QCOMPARE(contentAttachmentList[1]->content().size(), 1); QCOMPARE(contentAttachmentList[1]->encryptions().size(), 0); QCOMPARE(contentAttachmentList[1]->signatures().size(), 0); + QCOMPARE(contentAttachmentList[1]->encryptionState(), MimeTreeParser::KMMsgNotEncrypted); + QCOMPARE(contentAttachmentList[1]->signatureState(), MimeTreeParser::KMMsgNotSigned); } void testOpenPGPInline() @@ -173,6 +179,9 @@ private slots: //TODO test if we get the proper subparts with the appropriate encryptions QCOMPARE(part1->charset(), QStringLiteral("us-ascii").toLocal8Bit()); + QCOMPARE(part1->encryptionState(), MimeTreeParser::KMMsgPartiallyEncrypted); + QCOMPARE(part1->signatureState(), MimeTreeParser::KMMsgNotSigned); + // QCOMPARE(part1->text(), QStringLiteral("Not encrypted not signed :(\n\n")); // QCOMPARE(part1->charset(), QStringLiteral("us-ascii").toLocal8Bit()); // QCOMPARE(contentList[1]->content(), QStringLiteral("some random text").toLocal8Bit()); -- cgit v1.2.3