diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/carddavresource/tests/carddavtest.cpp | 15 |
1 files 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: | |||
129 | 129 | ||
130 | void testSyncContacts() | 130 | void testSyncContacts() |
131 | { | 131 | { |
132 | //We want the extra collection from the previous test in this test. | ||
133 | createContact("john", "doe", "personal"); | 132 | createContact("john", "doe", "personal"); |
134 | createContact("jane", "doe", "personal"); | 133 | createContact("jane", "doe", "personal"); |
134 | createContact("fred", "durst", "addressbook2"); | ||
135 | Sink::SyncScope scope; | 135 | Sink::SyncScope scope; |
136 | scope.setType<Sink::ApplicationDomain::Contact>(); | 136 | scope.setType<Sink::ApplicationDomain::Contact>(); |
137 | scope.resourceFilter(mResourceInstanceIdentifier); | 137 | scope.resourceFilter(mResourceInstanceIdentifier); |
@@ -139,14 +139,23 @@ private slots: | |||
139 | VERIFYEXEC(Sink::Store::synchronize(scope)); | 139 | VERIFYEXEC(Sink::Store::synchronize(scope)); |
140 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); | 140 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); |
141 | const auto contacts = Sink::Store::read<Sink::ApplicationDomain::Contact>(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); | 141 | const auto contacts = Sink::Store::read<Sink::ApplicationDomain::Contact>(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); |
142 | QCOMPARE(contacts.size(), 2); | 142 | QCOMPARE(contacts.size(), 3); |
143 | 143 | ||
144 | //Ensure a resync works | 144 | //Ensure a resync works |
145 | { | 145 | { |
146 | VERIFYEXEC(Sink::Store::synchronize(scope)); | 146 | VERIFYEXEC(Sink::Store::synchronize(scope)); |
147 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); | 147 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); |
148 | const auto contacts = Sink::Store::read<Sink::ApplicationDomain::Contact>(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); | 148 | const auto contacts = Sink::Store::read<Sink::ApplicationDomain::Contact>(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); |
149 | QCOMPARE(contacts.size(), 2); | 149 | QCOMPARE(contacts.size(), 3); |
150 | } | ||
151 | |||
152 | //Ensure a resync after another creation works | ||
153 | createContact("alf", "alf", "addressbook2"); | ||
154 | { | ||
155 | VERIFYEXEC(Sink::Store::synchronize(scope)); | ||
156 | VERIFYEXEC(Sink::ResourceControl::flushMessageQueue(mResourceInstanceIdentifier)); | ||
157 | const auto contacts = Sink::Store::read<Sink::ApplicationDomain::Contact>(Sink::Query().resourceFilter(mResourceInstanceIdentifier)); | ||
158 | QCOMPARE(contacts.size(), 4); | ||
150 | } | 159 | } |
151 | } | 160 | } |
152 | 161 | ||