diff options
Diffstat (limited to 'tests/maildirresourcetest.cpp')
-rw-r--r-- | tests/maildirresourcetest.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/maildirresourcetest.cpp b/tests/maildirresourcetest.cpp index c649536..046c920 100644 --- a/tests/maildirresourcetest.cpp +++ b/tests/maildirresourcetest.cpp | |||
@@ -353,14 +353,22 @@ private Q_SLOTS: | |||
353 | return Akonadi2::Store::modify(*mail); | 353 | return Akonadi2::Store::modify(*mail); |
354 | }) | 354 | }) |
355 | .then<void>(Akonadi2::Store::flushMessageQueue(query.resources)) | 355 | .then<void>(Akonadi2::Store::flushMessageQueue(query.resources)) |
356 | .then<void, KAsync::Job<void> >([folder]() -> KAsync::Job<void> { | 356 | .then<void, KAsync::Job<void> >([folder]() { |
357 | return Store::fetchAll<Mail>( | 357 | return Store::fetchAll<Mail>( |
358 | Query::PropertyFilter("folder", folder) + Query::RequestedProperties(QByteArrayList() << "folder" << "subject" << "unread") | 358 | Query::PropertyFilter("folder", folder) + Query::RequestedProperties(QByteArrayList() << "folder" << "subject" << "unread") |
359 | ) | 359 | ) |
360 | .then<void, QList<Mail::Ptr> >([](const QList<Mail::Ptr> &mails) { | 360 | .then<void, KAsync::Job<void>, QList<Mail::Ptr>>([](const QList<Mail::Ptr> &mails) { |
361 | QCOMPARE(mails.size(), 1); | 361 | //Can't use QCOMPARE because it tries to return |
362 | if (mails.size() != 1) { | ||
363 | return KAsync::error<void>(1, "Wrong number of mails."); | ||
364 | } | ||
362 | auto mail = mails.first(); | 365 | auto mail = mails.first(); |
363 | QCOMPARE(mail->getProperty("unread").toBool(), true); | 366 | //Can't use QCOMPARE because it tries to return |
367 | if (mail->getProperty("unread").toBool() != true) { | ||
368 | return KAsync::error<void>(1, "Wrong property value."); | ||
369 | } | ||
370 | auto inspectionCommand = Akonadi2::Resources::Inspection::PropertyInspection(*mail, "unread", true); | ||
371 | return Akonadi2::Resources::inspect<Mail>(inspectionCommand); | ||
364 | }) | 372 | }) |
365 | .then<void>([](){}); | 373 | .then<void>([](){}); |
366 | }); | 374 | }); |