From 2d0608ddf1b84991ca7a693ce00e70b6447644d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20Knau=C3=9F?= Date: Tue, 2 Aug 2016 10:11:23 +0200 Subject: Implement collectAttachmentParts --- framework/domain/mimetreeparser/tests/interfacetest.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (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 615d5742..fb073fc1 100644 --- a/framework/domain/mimetreeparser/tests/interfacetest.cpp +++ b/framework/domain/mimetreeparser/tests/interfacetest.cpp @@ -79,6 +79,8 @@ private slots: contentList = contentPart->content("html"); QCOMPARE(contentList.size(), 0); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 0); } void testTextAlternative() @@ -103,6 +105,8 @@ private slots: QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); QCOMPARE(contentList[0]->encryptions().size(), 0); QCOMPARE(contentList[0]->signatures().size(), 0); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 0); } void testTextHtml() @@ -124,6 +128,8 @@ private slots: QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); QCOMPARE(contentList[0]->encryptions().size(), 0); QCOMPARE(contentList[0]->signatures().size(), 0); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 0); } void testSMimeEncrypted() @@ -139,6 +145,8 @@ private slots: QCOMPARE(contentList.size(), 1); QCOMPARE(contentList[0]->content(), QStringLiteral("The quick brown fox jumped over the lazy dog.").toLocal8Bit()); QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 0); } void testOpenPGPEncryptedAttachment() @@ -154,6 +162,12 @@ private slots: QCOMPARE(contentList.size(), 1); QCOMPARE(contentList[0]->content(), QStringLiteral("test text").toLocal8Bit()); QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 2); + QCOMPARE(contentAttachmentList[0]->availableContents(), QVector() << "text/plain"); + QCOMPARE(contentAttachmentList[0]->content().size(), 1); + QCOMPARE(contentAttachmentList[1]->availableContents(), QVector() << "image/png"); + QCOMPARE(contentAttachmentList[1]->content().size(), 1); } void testOpenPPGInline() @@ -169,6 +183,8 @@ private slots: QCOMPARE(contentList.size(), 1); QCOMPARE(contentList[0]->content(), QStringLiteral("asdasd asd asd asdf sadf sdaf sadf äöü").toLocal8Bit()); QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); + auto contentAttachmentList = parser.collectAttachmentParts(); + QCOMPARE(contentAttachmentList.size(), 0); } }; -- cgit v1.2.3