summaryrefslogtreecommitdiffstats
path: root/tests/storagetest.cpp
diff options
context:
space:
mode:
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 2e69634..7060ef2 100644
--- a/tests/storagetest.cpp
+++ b/tests/storagetest.cpp
@@ -29,7 +29,7 @@ private:
29 transaction = std::move(storage.createTransaction(Akonadi2::Storage::ReadWrite)); 29 transaction = std::move(storage.createTransaction(Akonadi2::Storage::ReadWrite));
30 } 30 }
31 } 31 }
32 transaction.write(keyPrefix + QByteArray::number(i), keyPrefix + QByteArray::number(i)); 32 transaction.openDatabase().write(keyPrefix + QByteArray::number(i), keyPrefix + QByteArray::number(i));
33 } 33 }
34 transaction.commit(); 34 transaction.commit();
35 } 35 }
@@ -39,7 +39,7 @@ private:
39 bool success = true; 39 bool success = true;
40 bool keyMatch = true; 40 bool keyMatch = true;
41 const auto reference = keyPrefix + QByteArray::number(i); 41 const auto reference = keyPrefix + QByteArray::number(i);
42 storage.createTransaction(Akonadi2::Storage::ReadOnly).scan(keyPrefix + QByteArray::number(i), 42 storage.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan(keyPrefix + QByteArray::number(i),
43 [&keyMatch, &reference](const QByteArray &key, const QByteArray &value) -> bool { 43 [&keyMatch, &reference](const QByteArray &key, const QByteArray &value) -> bool {
44 if (value != reference) { 44 if (value != reference) {
45 qDebug() << "Mismatch while reading"; 45 qDebug() << "Mismatch while reading";
@@ -103,7 +103,7 @@ private Q_SLOTS:
103 { 103 {
104 int hit = 0; 104 int hit = 0;
105 Akonadi2::Storage store(testDataPath, dbName); 105 Akonadi2::Storage store(testDataPath, dbName);
106 store.createTransaction(Akonadi2::Storage::ReadOnly).scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { 106 store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("", [&](const QByteArray &key, const QByteArray &value) -> bool {
107 if (key == "key50") { 107 if (key == "key50") {
108 hit++; 108 hit++;
109 } 109 }
@@ -117,7 +117,7 @@ private Q_SLOTS:
117 int hit = 0; 117 int hit = 0;
118 bool foundInvalidValue = false; 118 bool foundInvalidValue = false;
119 Akonadi2::Storage store(testDataPath, dbName); 119 Akonadi2::Storage store(testDataPath, dbName);
120 store.createTransaction(Akonadi2::Storage::ReadOnly).scan("key50", [&](const QByteArray &key, const QByteArray &value) -> bool { 120 store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("key50", [&](const QByteArray &key, const QByteArray &value) -> bool {
121 if (key != "key50") { 121 if (key != "key50") {
122 foundInvalidValue = true; 122 foundInvalidValue = true;
123 } 123 }
@@ -134,8 +134,8 @@ private Q_SLOTS:
134 populate(3); 134 populate(3);
135 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); 135 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
136 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite); 136 auto transaction = store.createTransaction(Akonadi2::Storage::ReadWrite);
137 transaction.scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { 137 transaction.openDatabase().scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool {
138 transaction.remove(key, [](const Akonadi2::Storage::Error &) { 138 transaction.openDatabase().remove(key, [](const Akonadi2::Storage::Error &) {
139 QVERIFY(false); 139 QVERIFY(false);
140 }); 140 });
141 return false; 141 return false;
@@ -146,8 +146,8 @@ private Q_SLOTS:
146 { 146 {
147 populate(3); 147 populate(3);
148 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); 148 Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite);
149 store.createTransaction(Akonadi2::Storage::ReadOnly).scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { 149 store.createTransaction(Akonadi2::Storage::ReadOnly).openDatabase().scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool {
150 store.createTransaction(Akonadi2::Storage::ReadWrite).remove(key, [](const Akonadi2::Storage::Error &) { 150 store.createTransaction(Akonadi2::Storage::ReadWrite).openDatabase().remove(key, [](const Akonadi2::Storage::Error &) {
151 QVERIFY(false); 151 QVERIFY(false);
152 }); 152 });
153 return false; 153 return false;