diff options
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r-- | tests/storagetest.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
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: | |||
59 | { | 59 | { |
60 | testDataPath = "./testdb"; | 60 | testDataPath = "./testdb"; |
61 | dbName = "test"; | 61 | dbName = "test"; |
62 | Akonadi2::Storage storage(testDataPath, dbName); | ||
63 | storage.removeFromDisk(); | ||
62 | } | 64 | } |
63 | 65 | ||
64 | void cleanupTestCase() | 66 | void cleanupTestCase() |
@@ -136,6 +138,23 @@ private Q_SLOTS: | |||
136 | store.removeFromDisk(); | 138 | store.removeFromDisk(); |
137 | } | 139 | } |
138 | 140 | ||
141 | void testReadEmptyDb() | ||
142 | { | ||
143 | bool gotResult = false; | ||
144 | bool gotError = false; | ||
145 | Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); | ||
146 | store.scan(0, 0, [&](void *keyValue, int keySize, void *dataValue, int dataSize) -> bool { | ||
147 | gotResult = true; | ||
148 | return false; | ||
149 | }, | ||
150 | [&](Akonadi2::Storage::Error) { | ||
151 | gotError = true; | ||
152 | }); | ||
153 | QVERIFY(!gotResult); | ||
154 | QVERIFY(!gotError); | ||
155 | store.removeFromDisk(); | ||
156 | } | ||
157 | |||
139 | void testConcurrentRead() | 158 | void testConcurrentRead() |
140 | { | 159 | { |
141 | const int count = 10000; | 160 | const int count = 10000; |
@@ -170,6 +189,8 @@ private Q_SLOTS: | |||
170 | { | 189 | { |
171 | Akonadi2::Storage storage(testDataPath, dbName); | 190 | Akonadi2::Storage storage(testDataPath, dbName); |
172 | storage.removeFromDisk(); | 191 | storage.removeFromDisk(); |
192 | Akonadi2::Storage storage2(testDataPath, dbName + "2"); | ||
193 | storage2.removeFromDisk(); | ||
173 | } | 194 | } |
174 | } | 195 | } |
175 | }; | 196 | }; |