From 1974c19eadd497e355ac985a00d0571f3e6c7712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 11 Oct 2016 16:18:50 +0200 Subject: create model for new mailviewer --- .../domain/mimetreeparser/tests/interfacetest.cpp | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'framework/domain/mimetreeparser/tests/interfacetest.cpp') diff --git a/framework/domain/mimetreeparser/tests/interfacetest.cpp b/framework/domain/mimetreeparser/tests/interfacetest.cpp index ac77b025..5a3cbb87 100644 --- a/framework/domain/mimetreeparser/tests/interfacetest.cpp +++ b/framework/domain/mimetreeparser/tests/interfacetest.cpp @@ -198,7 +198,32 @@ private slots: auto contentAttachmentList = parser.collectAttachmentParts(); QCOMPARE(contentAttachmentList.size(), 0); } + + void testOpenPPGInlineWithNonEncText() + { + Parser parser(readMailFromFile("openpgp-inline-encrypted+nonenc.mbox")); + printTree(parser.d->mTree,QString()); + auto contentPartList = parser.collectContentParts(); + QCOMPARE(contentPartList.size(), 1); + auto contentPart = contentPartList[0]; + QVERIFY((bool)contentPart); + QCOMPARE(contentPart->availableContents(), QVector() << "plaintext"); + QCOMPARE(contentPart->encryptions().size(), 0); + QCOMPARE(contentPart->signatures().size(), 0); + auto contentList = contentPart->content("plaintext"); + QCOMPARE(contentList.size(), 2); + QCOMPARE(contentList[0]->content(), QStringLiteral("Not encrypted not signed :(\n\n").toLocal8Bit()); + QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); + QCOMPARE(contentList[0]->encryptions().size(), 0); + QCOMPARE(contentList[0]->signatures().size(), 0); + QCOMPARE(contentList[1]->content(), QStringLiteral("some random text").toLocal8Bit()); + QCOMPARE(contentList[1]->charset(), QStringLiteral("utf-8").toLocal8Bit()); + QCOMPARE(contentList[1]->encryptions().size(), 1); + QCOMPARE(contentList[1]->signatures().size(), 0); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 0); + } }; QTEST_GUILESS_MAIN(InterfaceTest) -#include "interfacetest.moc" \ No newline at end of file +#include "interfacetest.moc" -- cgit v1.2.3