From f689ad1021a7805f6f8b6a81f534b4cb9ca91f51 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 6 Oct 2015 16:19:51 +0200 Subject: Change replay So far only includes modifications and additions, removals are not yet stored as separate revisions. --- tests/dummyresourcetest.cpp | 4 ---- tests/genericfacadetest.cpp | 5 +++++ tests/storagetest.cpp | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/dummyresourcetest.cpp b/tests/dummyresourcetest.cpp index a28e071..caf808a 100644 --- a/tests/dummyresourcetest.cpp +++ b/tests/dummyresourcetest.cpp @@ -2,10 +2,6 @@ #include -#include "event_generated.h" -#include "entity_generated.h" -#include "metadata_generated.h" -#include "createentity_generated.h" #include "dummyresource/resourcefactory.h" #include "clientapi.h" #include "synclistresult.h" diff --git a/tests/genericfacadetest.cpp b/tests/genericfacadetest.cpp index 45ca54d..4c58b91 100644 --- a/tests/genericfacadetest.cpp +++ b/tests/genericfacadetest.cpp @@ -68,6 +68,11 @@ class GenericFacadeTest : public QObject Q_OBJECT private Q_SLOTS: + void init() + { + Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); + } + void testLoad() { Akonadi2::Query query; diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index 8d5ee00..8e841cb 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -381,6 +381,15 @@ private Q_SLOTS: QCOMPARE(result, QByteArray("value2")); } + + void testRecordRevision() + { + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); + auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); + Akonadi2::Storage::recordRevision(transaction, 1, "uid", "type"); + QCOMPARE(Akonadi2::Storage::getTypeFromRevision(transaction, 1), QByteArray("type")); + QCOMPARE(Akonadi2::Storage::getUidFromRevision(transaction, 1), QByteArray("uid")); + } }; QTEST_MAIN(StorageTest) -- cgit v1.2.3