diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-16 10:29:27 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-16 10:39:59 +0100 |
commit | 768c1077b0d226d832f34904e929c2462eca158f (patch) | |
tree | 62ebe65b534ce4028ff24f29a0824540810179ff /tests/mailsynctest.cpp | |
parent | 80f8c4a48b8cbb359c4efdb9a13485bf86b4d1ed (diff) | |
download | sink-768c1077b0d226d832f34904e929c2462eca158f.tar.gz sink-768c1077b0d226d832f34904e929c2462eca158f.zip |
Remember whether a blob property is external or not.
...we used to accidentally move external blobs after the property was
lost when storing the modificatoin in the queue.
Diffstat (limited to 'tests/mailsynctest.cpp')
-rw-r--r-- | tests/mailsynctest.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/mailsynctest.cpp b/tests/mailsynctest.cpp index d3b0fe3..3e5a928 100644 --- a/tests/mailsynctest.cpp +++ b/tests/mailsynctest.cpp | |||
@@ -271,16 +271,17 @@ void MailSyncTest::testListMails() | |||
271 | 271 | ||
272 | auto job = Store::fetchAll<Mail>(query).then([](const QList<Mail::Ptr> &mails) { | 272 | auto job = Store::fetchAll<Mail>(query).then([](const QList<Mail::Ptr> &mails) { |
273 | QCOMPARE(mails.size(), 1); | 273 | QCOMPARE(mails.size(), 1); |
274 | QVERIFY(mails.first()->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); | 274 | auto mail = mails.first(); |
275 | const auto data = mails.first()->getMimeMessage(); | 275 | QVERIFY(mail->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); |
276 | const auto data = mail->getMimeMessage(); | ||
276 | QVERIFY(!data.isEmpty()); | 277 | QVERIFY(!data.isEmpty()); |
277 | 278 | ||
278 | KMime::Message m; | 279 | KMime::Message m; |
279 | m.setContent(data); | 280 | m.setContent(data); |
280 | m.parse(); | 281 | m.parse(); |
281 | QCOMPARE(mails.first()->getSubject(), m.subject(true)->asUnicodeString()); | 282 | QCOMPARE(mail->getSubject(), m.subject(true)->asUnicodeString()); |
282 | QVERIFY(!mails.first()->getFolder().isEmpty()); | 283 | QVERIFY(!mail->getFolder().isEmpty()); |
283 | QVERIFY(mails.first()->getDate().isValid()); | 284 | QVERIFY(mail->getDate().isValid()); |
284 | }); | 285 | }); |
285 | VERIFYEXEC(job); | 286 | VERIFYEXEC(job); |
286 | } | 287 | } |
@@ -289,6 +290,8 @@ void MailSyncTest::testResyncMails() | |||
289 | { | 290 | { |
290 | Sink::Query query; | 291 | Sink::Query query; |
291 | query.resourceFilter(mResourceInstanceIdentifier); | 292 | query.resourceFilter(mResourceInstanceIdentifier); |
293 | query.request<Mail::MimeMessage>(); | ||
294 | query.request<Mail::Subject>(); | ||
292 | 295 | ||
293 | // Ensure all local data is processed | 296 | // Ensure all local data is processed |
294 | VERIFYEXEC(Store::synchronize(query)); | 297 | VERIFYEXEC(Store::synchronize(query)); |
@@ -300,6 +303,9 @@ void MailSyncTest::testResyncMails() | |||
300 | 303 | ||
301 | auto job = Store::fetchAll<Mail>(query).then([](const QList<Mail::Ptr> &mails) { | 304 | auto job = Store::fetchAll<Mail>(query).then([](const QList<Mail::Ptr> &mails) { |
302 | QCOMPARE(mails.size(), 1); | 305 | QCOMPARE(mails.size(), 1); |
306 | auto mail = mails.first(); | ||
307 | QVERIFY(!mail->getSubject().isEmpty()); | ||
308 | QVERIFY(!mail->getMimeMessagePath().isEmpty()); | ||
303 | }); | 309 | }); |
304 | VERIFYEXEC(job); | 310 | VERIFYEXEC(job); |
305 | } | 311 | } |