diff options
Diffstat (limited to 'framework/domain/mimetreeparser/tests')
-rw-r--r-- | framework/domain/mimetreeparser/tests/gpgerrortest.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/framework/domain/mimetreeparser/tests/gpgerrortest.cpp b/framework/domain/mimetreeparser/tests/gpgerrortest.cpp index aca12280..4254d972 100644 --- a/framework/domain/mimetreeparser/tests/gpgerrortest.cpp +++ b/framework/domain/mimetreeparser/tests/gpgerrortest.cpp | |||
@@ -71,7 +71,10 @@ private slots: | |||
71 | auto contentList = contentPart->content("plaintext"); | 71 | auto contentList = contentPart->content("plaintext"); |
72 | QVERIFY(contentList[0]->content().startsWith("asdasd")); | 72 | QVERIFY(contentList[0]->content().startsWith("asdasd")); |
73 | QCOMPARE(contentList[0]->encryptions().size(), 1); | 73 | QCOMPARE(contentList[0]->encryptions().size(), 1); |
74 | QCOMPARE(contentList[0]->signatures().size(), 1); | 74 | auto enc = contentList[0]->encryptions()[0]; |
75 | QCOMPARE(enc->errorType(), Encryption::NoError); | ||
76 | QCOMPARE(enc->errorString(), QString()); | ||
77 | QCOMPARE((int) enc->recipients().size(), 2); | ||
75 | } | 78 | } |
76 | 79 | ||
77 | void testNoGPGInstalled_data() | 80 | void testNoGPGInstalled_data() |
@@ -98,8 +101,12 @@ private slots: | |||
98 | QCOMPARE(contentPart->availableContents(), QVector<QByteArray>() << "plaintext"); | 101 | QCOMPARE(contentPart->availableContents(), QVector<QByteArray>() << "plaintext"); |
99 | auto contentList = contentPart->content("plaintext"); | 102 | auto contentList = contentPart->content("plaintext"); |
100 | QCOMPARE(contentList[0]->encryptions().size(), 1); | 103 | QCOMPARE(contentList[0]->encryptions().size(), 1); |
101 | QCOMPARE(contentList[0]->signatures().size(), 0); | ||
102 | QVERIFY(contentList[0]->content().isEmpty()); | 104 | QVERIFY(contentList[0]->content().isEmpty()); |
105 | auto enc = contentList[0]->encryptions()[0]; | ||
106 | qDebug() << "HUHU"<< enc->errorType(); | ||
107 | QCOMPARE(enc->errorType(), Encryption::UnknownError); | ||
108 | QCOMPARE(enc->errorString(), QString("Crypto plug-in \"OpenPGP\" could not decrypt the data.<br />Error: No data")); | ||
109 | QCOMPARE((int) enc->recipients().size(), 0); | ||
103 | } | 110 | } |
104 | 111 | ||
105 | void testGpgIncorrectGPGHOME_data() | 112 | void testGpgIncorrectGPGHOME_data() |
@@ -126,6 +133,11 @@ private slots: | |||
126 | QCOMPARE(contentList[0]->encryptions().size(), 1); | 133 | QCOMPARE(contentList[0]->encryptions().size(), 1); |
127 | QCOMPARE(contentList[0]->signatures().size(), 0); | 134 | QCOMPARE(contentList[0]->signatures().size(), 0); |
128 | QVERIFY(contentList[0]->content().isEmpty()); | 135 | QVERIFY(contentList[0]->content().isEmpty()); |
136 | auto enc = contentList[0]->encryptions()[0]; | ||
137 | qDebug() << enc->errorType(); | ||
138 | QCOMPARE(enc->errorType(), Encryption::KeyMissing); | ||
139 | QCOMPARE(enc->errorString(), QString("Crypto plug-in \"OpenPGP\" could not decrypt the data.<br />Error: Decryption failed")); | ||
140 | QCOMPARE((int) enc->recipients().size(), 2); | ||
129 | } | 141 | } |
130 | 142 | ||
131 | public Q_SLOTS: | 143 | public Q_SLOTS: |