From ae0255bf8eb913004082278af27d69047503ea71 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 23 Aug 2015 19:07:21 +0200 Subject: Storage cleanup --- tests/storagetest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') 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: { bool gotResult = false; bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, false); + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); auto db = transaction.openDatabase("default", nullptr, false); db.write("key","value"); @@ -244,7 +244,7 @@ private Q_SLOTS: { bool gotResult = false; bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); auto db = transaction.openDatabase("default", nullptr, true); db.write("key","value1"); @@ -294,8 +294,8 @@ private Q_SLOTS: void testWriteDuplicatesToNamedDb() { bool gotError = false; - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); - store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase("test").write("key1", "value1", [&](const Akonadi2::Storage::Error &error) { + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); + store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase("test", nullptr, true).write("key1", "value1", [&](const Akonadi2::Storage::Error &error) { qDebug() << error.message; gotError = true; }); @@ -305,9 +305,9 @@ private Q_SLOTS: //By default we want only exact matches void testSubstringKeys() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); - auto db = transaction.openDatabase(); + auto db = transaction.openDatabase("test", nullptr, true); db.write("sub","value1"); db.write("subsub","value2"); int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool { @@ -320,9 +320,9 @@ private Q_SLOTS: //Ensure we don't retrieve a key that is greater than the current key. We only want equal keys. void testKeyRange() { - Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite, true); + Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); - auto db = transaction.openDatabase(); + auto db = transaction.openDatabase("test", nullptr, true); db.write("sub1","value1"); int numValues = db.scan("sub", [&](const QByteArray &key, const QByteArray &value) -> bool { return true; -- cgit v1.2.3