summaryrefslogtreecommitdiffstats
path: root/tests/storagetest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2015-08-23 19:07:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2015-08-23 19:07:21 +0200
commitae0255bf8eb913004082278af27d69047503ea71 (patch)
treefbe5f2a8a22776c8eec5c51df1da3727b24f9ede /tests/storagetest.cpp
parent91cb5bf93c7eb1caad910b693927d80e552239b1 (diff)
downloadsink-ae0255bf8eb913004082278af27d69047503ea71.tar.gz
sink-ae0255bf8eb913004082278af27d69047503ea71.zip
Storage cleanup
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r--tests/storagetest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp
index 6ba4bcd..2e69634 100644
--- a/tests/storagetest.cpp
+++ b/tests/storagetest.cpp
@@ -221,7 +221,7 @@ private Q_SLOTS:
221 { 221 {
222 bool gotResult = false; 222 bool gotResult = false;
223 bool gotError = false; 223 bool gotError = false;
224 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, false); 224 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
225 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 225 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
226 auto db = transaction.openDatabase("default", nullptr, false); 226 auto db = transaction.openDatabase("default", nullptr, false);
227 db.write("key","value"); 227 db.write("key","value");
@@ -244,7 +244,7 @@ private Q_SLOTS:
244 { 244 {
245 bool gotResult = false; 245 bool gotResult = false;
246 bool gotError = false; 246 bool gotError = false;
247 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); 247 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
248 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 248 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
249 auto db = transaction.openDatabase("default", nullptr, true); 249 auto db = transaction.openDatabase("default", nullptr, true);
250 db.write("key","value1"); 250 db.write("key","value1");
@@ -294,8 +294,8 @@ private Q_SLOTS:
294 void testWriteDuplicatesToNamedDb() 294 void testWriteDuplicatesToNamedDb()
295 { 295 {
296 bool gotError = false; 296 bool gotError = false;
297 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); 297 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
298 store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase("test").write("key1", "value1", [&](const Akonadi2::Storage::Error &error) { 298 store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase("test", nullptr, true).write("key1", "value1", [&](const Akonadi2::Storage::Error &error) {
299 qDebug() << error.message; 299 qDebug() << error.message;
300 gotError = true; 300 gotError = true;
301 }); 301 });
@@ -305,9 +305,9 @@ private Q_SLOTS:
305 //By default we want only exact matches 305 //By default we want only exact matches
306 void testSubstringKeys() 306 void testSubstringKeys()
307 { 307 {
308 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); 308 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
309 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 309 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
310 auto db = transaction.openDatabase(); 310 auto db = transaction.openDatabase("test", nullptr, true);
311 db.write("sub","value1"); 311 db.write("sub","value1");
312 db.write("subsub","value2"); 312 db.write("subsub","value2");
313 int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool { 313 int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool {
@@ -320,9 +320,9 @@ private Q_SLOTS:
320 //Ensure we don't retrieve a key that is greater than the current key. We only want equal keys. 320 //Ensure we don't retrieve a key that is greater than the current key. We only want equal keys.
321 void testKeyRange() 321 void testKeyRange()
322 { 322 {
323 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); 323 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
324 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 324 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
325 auto db = transaction.openDatabase(); 325 auto db = transaction.openDatabase("test", nullptr, true);
326 db.write("sub1","value1"); 326 db.write("sub1","value1");
327 int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool { 327 int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool {
328 return true; 328 return true;