From 768c1077b0d226d832f34904e929c2462eca158f Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 16 Feb 2017 10:29:27 +0100 Subject: 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. --- tests/mailsynctest.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests') 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() auto job = Store::fetchAll(query).then([](const QList &mails) { QCOMPARE(mails.size(), 1); - QVERIFY(mails.first()->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); - const auto data = mails.first()->getMimeMessage(); + auto mail = mails.first(); + QVERIFY(mail->getSubject().startsWith(QString("[Nepomuk] Jenkins build is still unstable"))); + const auto data = mail->getMimeMessage(); QVERIFY(!data.isEmpty()); KMime::Message m; m.setContent(data); m.parse(); - QCOMPARE(mails.first()->getSubject(), m.subject(true)->asUnicodeString()); - QVERIFY(!mails.first()->getFolder().isEmpty()); - QVERIFY(mails.first()->getDate().isValid()); + QCOMPARE(mail->getSubject(), m.subject(true)->asUnicodeString()); + QVERIFY(!mail->getFolder().isEmpty()); + QVERIFY(mail->getDate().isValid()); }); VERIFYEXEC(job); } @@ -289,6 +290,8 @@ void MailSyncTest::testResyncMails() { Sink::Query query; query.resourceFilter(mResourceInstanceIdentifier); + query.request(); + query.request(); // Ensure all local data is processed VERIFYEXEC(Store::synchronize(query)); @@ -300,6 +303,9 @@ void MailSyncTest::testResyncMails() auto job = Store::fetchAll(query).then([](const QList &mails) { QCOMPARE(mails.size(), 1); + auto mail = mails.first(); + QVERIFY(!mail->getSubject().isEmpty()); + QVERIFY(!mail->getMimeMessagePath().isEmpty()); }); VERIFYEXEC(job); } -- cgit v1.2.3