summaryrefslogtreecommitdiffstats
path: root/tests/pipelinetest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-09-29 00:52:07 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-09-29 00:52:07 +0200
commitc3f6e72c2d46906a4699127b558ca248729ce577 (patch)
treea2066e43b45a01226e19bbb309fabf7064018a06 /tests/pipelinetest.cpp
parentb43c422a2b1b899ce5ac27a0bc381e8a49f05d86 (diff)
downloadsink-c3f6e72c2d46906a4699127b558ca248729ce577.tar.gz
sink-c3f6e72c2d46906a4699127b558ca248729ce577.zip
Revision cleanup
Diffstat (limited to 'tests/pipelinetest.cpp')
-rw-r--r--tests/pipelinetest.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp
index 96448e2..5dede64 100644
--- a/tests/pipelinetest.cpp
+++ b/tests/pipelinetest.cpp
@@ -210,6 +210,17 @@ private Q_SLOTS:
210 Akonadi2::EntityBuffer entityBuffer(buffer.data(), buffer.size()); 210 Akonadi2::EntityBuffer entityBuffer(buffer.data(), buffer.size());
211 auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity()); 211 auto adaptor = adaptorFactory->createAdaptor(entityBuffer.entity());
212 QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2")); 212 QCOMPARE(adaptor->getProperty("summary").toString(), QString("summary2"));
213
214 //Both revisions are in the store at this point
215 QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 2);
216
217 //Cleanup old revisions
218 pipeline.startTransaction();
219 pipeline.cleanupRevision(2);
220 pipeline.commit();
221
222 //And now only the latest revision is left
223 QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 1);
213 } 224 }
214 225
215 void testDelete() 226 void testDelete()
@@ -230,10 +241,18 @@ private Q_SLOTS:
230 const auto uid = Akonadi2::Storage::uidFromKey(result.first()); 241 const auto uid = Akonadi2::Storage::uidFromKey(result.first());
231 242
232 //Delete entity 243 //Delete entity
233 auto deleteCommand = deleteEntityCommand(uid,1); 244 auto deleteCommand = deleteEntityCommand(uid, 1);
234 pipeline.startTransaction(); 245 pipeline.startTransaction();
235 pipeline.deletedEntity(deleteCommand.constData(), deleteCommand.size()); 246 pipeline.deletedEntity(deleteCommand.constData(), deleteCommand.size());
236 pipeline.commit(); 247 pipeline.commit();
248
249 //Cleanup old revisions
250 pipeline.startTransaction();
251 pipeline.cleanupRevision(2);
252 pipeline.commit();
253
254 //And all revisions are gone
255 QCOMPARE(getKeys("org.kde.pipelinetest.instance1", "event.main").size(), 0);
237 } 256 }
238}; 257};
239 258