From 08b39a731b3e787377e3e08e236cabe7fecf1e85 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 17 Aug 2018 21:28:58 +0200 Subject: Demonstrate the syncing problems we have --- examples/carddavresource/tests/carddavtest.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/carddavresource/tests/carddavtest.cpp b/examples/carddavresource/tests/carddavtest.cpp index f75a30a..1d6762d 100644 --- a/examples/carddavresource/tests/carddavtest.cpp +++ b/examples/carddavresource/tests/carddavtest.cpp @@ -129,9 +129,9 @@ private slots: void testSyncContacts() { - //We want the extra collection from the previous test in this test. createContact("john", "doe", "personal"); createContact("jane", "doe", "personal"); + createContact("fred", "durst", "addressbook2"); Sink::SyncScope scope; scope.setType(); scope.resourceFilter(mResourceInstanceIdentifier); @@ -139,14 +139,23 @@ private slots: VERIFYEXEC(Sink::Store::synchronize(scope)); VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); const auto contacts = Sink::Store::read(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); - QCOMPARE(contacts.size(), 2); + QCOMPARE(contacts.size(), 3); //Ensure a resync works { VERIFYEXEC(Sink::Store::synchronize(scope)); VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); const auto contacts = Sink::Store::read(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); - QCOMPARE(contacts.size(), 2); + QCOMPARE(contacts.size(), 3); + } + + //Ensure a resync after another creation works + createContact("alf", "alf", "addressbook2"); + { + VERIFYEXEC(Sink::Store::synchronize(scope)); + VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); + const auto contacts = Sink::Store::read(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); + QCOMPARE(contacts.size(), 4); } } -- cgit v1.2.3