summaryrefslogtreecommitdiffstats
path: root/framework/domain/mimetreeparser/tests/interfacetest.cpp
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-08-02 10:11:23 +0200
committerSandro Knauß <sknauss@kde.org>2016-08-02 10:11:23 +0200
commit2d0608ddf1b84991ca7a693ce00e70b6447644d9 (patch)
treed90888ebe04f97bba950ca4e4704d2ff0278ea4a /framework/domain/mimetreeparser/tests/interfacetest.cpp
parentc64288bfe549ccc95eb6b887f3b803b397ae412c (diff)
downloadkube-2d0608ddf1b84991ca7a693ce00e70b6447644d9.tar.gz
kube-2d0608ddf1b84991ca7a693ce00e70b6447644d9.zip
Implement collectAttachmentParts
Diffstat (limited to 'framework/domain/mimetreeparser/tests/interfacetest.cpp')
-rw-r--r--framework/domain/mimetreeparser/tests/interfacetest.cpp16
1 files changed, 16 insertions, 0 deletions
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:
79 79
80 contentList = contentPart->content("html"); 80 contentList = contentPart->content("html");
81 QCOMPARE(contentList.size(), 0); 81 QCOMPARE(contentList.size(), 0);
82 auto contentAttachmentList = parser.collectAttachmentParts();
83 QCOMPARE(contentAttachmentList.size(), 0);
82 } 84 }
83 85
84 void testTextAlternative() 86 void testTextAlternative()
@@ -103,6 +105,8 @@ private slots:
103 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); 105 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit());
104 QCOMPARE(contentList[0]->encryptions().size(), 0); 106 QCOMPARE(contentList[0]->encryptions().size(), 0);
105 QCOMPARE(contentList[0]->signatures().size(), 0); 107 QCOMPARE(contentList[0]->signatures().size(), 0);
108 auto contentAttachmentList = parser.collectAttachmentParts();
109 QCOMPARE(contentAttachmentList.size(), 0);
106 } 110 }
107 111
108 void testTextHtml() 112 void testTextHtml()
@@ -124,6 +128,8 @@ private slots:
124 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); 128 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit());
125 QCOMPARE(contentList[0]->encryptions().size(), 0); 129 QCOMPARE(contentList[0]->encryptions().size(), 0);
126 QCOMPARE(contentList[0]->signatures().size(), 0); 130 QCOMPARE(contentList[0]->signatures().size(), 0);
131 auto contentAttachmentList = parser.collectAttachmentParts();
132 QCOMPARE(contentAttachmentList.size(), 0);
127 } 133 }
128 134
129 void testSMimeEncrypted() 135 void testSMimeEncrypted()
@@ -139,6 +145,8 @@ private slots:
139 QCOMPARE(contentList.size(), 1); 145 QCOMPARE(contentList.size(), 1);
140 QCOMPARE(contentList[0]->content(), QStringLiteral("The quick brown fox jumped over the lazy dog.").toLocal8Bit()); 146 QCOMPARE(contentList[0]->content(), QStringLiteral("The quick brown fox jumped over the lazy dog.").toLocal8Bit());
141 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); 147 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit());
148 auto contentAttachmentList = parser.collectAttachmentParts();
149 QCOMPARE(contentAttachmentList.size(), 0);
142 } 150 }
143 151
144 void testOpenPGPEncryptedAttachment() 152 void testOpenPGPEncryptedAttachment()
@@ -154,6 +162,12 @@ private slots:
154 QCOMPARE(contentList.size(), 1); 162 QCOMPARE(contentList.size(), 1);
155 QCOMPARE(contentList[0]->content(), QStringLiteral("test text").toLocal8Bit()); 163 QCOMPARE(contentList[0]->content(), QStringLiteral("test text").toLocal8Bit());
156 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); 164 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit());
165 auto contentAttachmentList = parser.collectAttachmentParts();
166 QCOMPARE(contentAttachmentList.size(), 2);
167 QCOMPARE(contentAttachmentList[0]->availableContents(), QVector<QByteArray>() << "text/plain");
168 QCOMPARE(contentAttachmentList[0]->content().size(), 1);
169 QCOMPARE(contentAttachmentList[1]->availableContents(), QVector<QByteArray>() << "image/png");
170 QCOMPARE(contentAttachmentList[1]->content().size(), 1);
157 } 171 }
158 172
159 void testOpenPPGInline() 173 void testOpenPPGInline()
@@ -169,6 +183,8 @@ private slots:
169 QCOMPARE(contentList.size(), 1); 183 QCOMPARE(contentList.size(), 1);
170 QCOMPARE(contentList[0]->content(), QStringLiteral("asdasd asd asd asdf sadf sdaf sadf äöü").toLocal8Bit()); 184 QCOMPARE(contentList[0]->content(), QStringLiteral("asdasd asd asd asdf sadf sdaf sadf äöü").toLocal8Bit());
171 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit()); 185 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit());
186 auto contentAttachmentList = parser.collectAttachmentParts();
187 QCOMPARE(contentAttachmentList.size(), 0);
172 } 188 }
173}; 189};
174 190