summaryrefslogtreecommitdiffstats
path: root/tests/maildirresourcetest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/maildirresourcetest.cpp')
-rw-r--r--tests/maildirresourcetest.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp
index 7cdfc36..e502d10 100644
--- a/tests/maildirresourcetest.cpp
+++ b/tests/maildirresourcetest.cpp
@@ -158,6 +158,9 @@ private Q_SLOTS:
158 QVERIFY(!mail->getProperty("subject").toString().isEmpty()); 158 QVERIFY(!mail->getProperty("subject").toString().isEmpty());
159 QVERIFY(!mail->getProperty("mimeMessage").toString().isEmpty()); 159 QVERIFY(!mail->getProperty("mimeMessage").toString().isEmpty());
160 QVERIFY(mail->getProperty("date").toDateTime().isValid()); 160 QVERIFY(mail->getProperty("date").toDateTime().isValid());
161
162 QFileInfo info(mail->getProperty("mimeMessage").toString());
163 QVERIFY(info.exists());
161 } 164 }
162 165
163 166
@@ -368,10 +371,11 @@ private Q_SLOTS:
368 result.waitForFinished(); 371 result.waitForFinished();
369 QVERIFY(!result.errorCode()); 372 QVERIFY(!result.errorCode());
370 373
374 //Verify that we can still query for all relevant information
371 auto result2 = Store::fetchAll<Mail>( 375 auto result2 = Store::fetchAll<Mail>(
372 Query::ResourceFilter("org.kde.maildir.instance1") + Query::PropertyFilter("folder", f) + Query::RequestedProperties(QByteArrayList() << "folder" << "subject") 376 Query::ResourceFilter("org.kde.maildir.instance1") + Query::PropertyFilter("folder", f) + Query::RequestedProperties(QByteArrayList() << "folder" << "subject" << "mimeMessage" << "unread")
373 ) 377 )
374 .then<void, KAsync::Job<void>, QList<Mail::Ptr> >([query](const QList<Mail::Ptr> &mails) { 378 .then<void, KAsync::Job<void>, QList<Mail::Ptr> >([](const QList<Mail::Ptr> &mails) {
375 //Can't use QCOMPARE because it tries to return FIXME Implement ASYNCCOMPARE 379 //Can't use QCOMPARE because it tries to return FIXME Implement ASYNCCOMPARE
376 if (mails.size() != 1) { 380 if (mails.size() != 1) {
377 qWarning() << "Wrong number of mails"; 381 qWarning() << "Wrong number of mails";
@@ -382,6 +386,15 @@ private Q_SLOTS:
382 qWarning() << "Wrong subject"; 386 qWarning() << "Wrong subject";
383 return KAsync::error<void>(1, "Wrong subject."); 387 return KAsync::error<void>(1, "Wrong subject.");
384 } 388 }
389 if (mail->getProperty("unread").toBool() != true) {
390 qWarning() << "Not unread";
391 return KAsync::error<void>(1, "Not unread.");
392 }
393 QFileInfo info(mail->getProperty("mimeMessage").toString());
394 if (!info.exists()) {
395 qWarning() << "Wrong subject";
396 return KAsync::error<void>(1, "Can't find mime message.");
397 }
385 return KAsync::null<void>(); 398 return KAsync::null<void>();
386 }) 399 })
387 .exec(); 400 .exec();