summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/mimetreeparser/tests
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-06-06 00:27:24 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-06-06 00:27:24 +0200
commit37983d97ec0eb03845f11eb03f429174acfd327b (patch)
tree9dbb5cdf8bbc463b43d38f45353b80b0f8ad7fe7 /framework/src/domain/mime/mimetreeparser/tests
parente98793cb59a1f29fe3b6980e0af3a48ed049024d (diff)
downloadkube-37983d97ec0eb03845f11eb03f429174acfd327b.tar.gz
kube-37983d97ec0eb03845f11eb03f429174acfd327b.zip
A simplistic security border
Still a bit obnoxious and doesn't really convey a whole lot of information. Consider it a stub for now
Diffstat (limited to 'framework/src/domain/mime/mimetreeparser/tests')
-rw-r--r--framework/src/domain/mime/mimetreeparser/tests/interfacetest.cpp9
1 files changed, 9 insertions, 0 deletions
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:
125 QCOMPARE(part->charset(), QStringLiteral("us-ascii").toLocal8Bit()); 125 QCOMPARE(part->charset(), QStringLiteral("us-ascii").toLocal8Bit());
126 QCOMPARE(part->encryptions().size(), 1); 126 QCOMPARE(part->encryptions().size(), 1);
127 QCOMPARE(part->signatures().size(), 1); 127 QCOMPARE(part->signatures().size(), 1);
128 QCOMPARE(part->encryptionState(), MimeTreeParser::KMMsgFullyEncrypted);
129 QCOMPARE(part->signatureState(), MimeTreeParser::KMMsgFullySigned);
128 auto contentAttachmentList = otp.collectAttachmentParts(); 130 auto contentAttachmentList = otp.collectAttachmentParts();
129 QCOMPARE(contentAttachmentList.size(), 2); 131 QCOMPARE(contentAttachmentList.size(), 2);
130 // QCOMPARE(contentAttachmentList[0]->availableContents(), QVector<QByteArray>() << "text/plain"); 132 // QCOMPARE(contentAttachmentList[0]->availableContents(), QVector<QByteArray>() << "text/plain");
131 // QCOMPARE(contentAttachmentList[0]->content().size(), 1); 133 // QCOMPARE(contentAttachmentList[0]->content().size(), 1);
132 QCOMPARE(contentAttachmentList[0]->encryptions().size(), 1); 134 QCOMPARE(contentAttachmentList[0]->encryptions().size(), 1);
133 QCOMPARE(contentAttachmentList[0]->signatures().size(), 1); 135 QCOMPARE(contentAttachmentList[0]->signatures().size(), 1);
136 QCOMPARE(contentAttachmentList[0]->encryptionState(), MimeTreeParser::KMMsgFullyEncrypted);
137 QCOMPARE(contentAttachmentList[0]->signatureState(), MimeTreeParser::KMMsgFullySigned);
134 // QCOMPARE(contentAttachmentList[1]->availableContents(), QVector<QByteArray>() << "image/png"); 138 // QCOMPARE(contentAttachmentList[1]->availableContents(), QVector<QByteArray>() << "image/png");
135 // QCOMPARE(contentAttachmentList[1]->content().size(), 1); 139 // QCOMPARE(contentAttachmentList[1]->content().size(), 1);
136 QCOMPARE(contentAttachmentList[1]->encryptions().size(), 0); 140 QCOMPARE(contentAttachmentList[1]->encryptions().size(), 0);
137 QCOMPARE(contentAttachmentList[1]->signatures().size(), 0); 141 QCOMPARE(contentAttachmentList[1]->signatures().size(), 0);
142 QCOMPARE(contentAttachmentList[1]->encryptionState(), MimeTreeParser::KMMsgNotEncrypted);
143 QCOMPARE(contentAttachmentList[1]->signatureState(), MimeTreeParser::KMMsgNotSigned);
138 } 144 }
139 145
140 void testOpenPGPInline() 146 void testOpenPGPInline()
@@ -173,6 +179,9 @@ private slots:
173 //TODO test if we get the proper subparts with the appropriate encryptions 179 //TODO test if we get the proper subparts with the appropriate encryptions
174 QCOMPARE(part1->charset(), QStringLiteral("us-ascii").toLocal8Bit()); 180 QCOMPARE(part1->charset(), QStringLiteral("us-ascii").toLocal8Bit());
175 181
182 QCOMPARE(part1->encryptionState(), MimeTreeParser::KMMsgPartiallyEncrypted);
183 QCOMPARE(part1->signatureState(), MimeTreeParser::KMMsgNotSigned);
184
176 // QCOMPARE(part1->text(), QStringLiteral("Not encrypted not signed :(\n\n")); 185 // QCOMPARE(part1->text(), QStringLiteral("Not encrypted not signed :(\n\n"));
177 // QCOMPARE(part1->charset(), QStringLiteral("us-ascii").toLocal8Bit()); 186 // QCOMPARE(part1->charset(), QStringLiteral("us-ascii").toLocal8Bit());
178 // QCOMPARE(contentList[1]->content(), QStringLiteral("some random text").toLocal8Bit()); 187 // QCOMPARE(contentList[1]->content(), QStringLiteral("some random text").toLocal8Bit());