From a0f517df8c4633d33820186954bdf803941e92bf Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 15 Jan 2015 23:04:22 +0100 Subject: storagetest --- tests/storagetest.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests') diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index 6c1d02b..516fe85 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -59,6 +59,8 @@ private Q_SLOTS: { testDataPath = "./testdb"; dbName = "test"; + Akonadi2::Storage storage(testDataPath, dbName); + storage.removeFromDisk(); } void cleanupTestCase() @@ -136,6 +138,23 @@ private Q_SLOTS: store.removeFromDisk(); } + void testReadEmptyDb() + { + bool gotResult = false; + bool gotError = false; + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); + store.scan(0, 0, [&](void *keyValue, int keySize, void *dataValue, int dataSize) -> bool { + gotResult = true; + return false; + }, + [&](Akonadi2::Storage::Error) { + gotError = true; + }); + QVERIFY(!gotResult); + QVERIFY(!gotError); + store.removeFromDisk(); + } + void testConcurrentRead() { const int count = 10000; @@ -170,6 +189,8 @@ private Q_SLOTS: { Akonadi2::Storage storage(testDataPath, dbName); storage.removeFromDisk(); + Akonadi2::Storage storage2(testDataPath, dbName + "2"); + storage2.removeFromDisk(); } } }; -- cgit v1.2.3