diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-12 00:58:28 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-12 00:58:28 +0200 |
commit | de860ce15b0921a37c0f3a21dbebe4311b9414a8 (patch) | |
tree | 4422df93c2cda64ecda44fcdfe53a60d640f6e93 /tests/storagetest.cpp | |
parent | 9812595ee44819e9bd4b430f275ef3941aaf038e (diff) | |
download | sink-de860ce15b0921a37c0f3a21dbebe4311b9414a8.tar.gz sink-de860ce15b0921a37c0f3a21dbebe4311b9414a8.zip |
Support for nested transactions
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r-- | tests/storagetest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index b71a767..55ec888 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp | |||
@@ -142,6 +142,18 @@ private Q_SLOTS: | |||
142 | }); | 142 | }); |
143 | } | 143 | } |
144 | 144 | ||
145 | void testNestedTransactions() | ||
146 | { | ||
147 | populate(3); | ||
148 | Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); | ||
149 | store.createTransaction(Akonadi2::Storage::ReadOnly).scan("key1", [&](const QByteArray &key, const QByteArray &value) -> bool { | ||
150 | store.createTransaction(Akonadi2::Storage::ReadWrite).remove(key, [](const Akonadi2::Storage::Error &) { | ||
151 | QVERIFY(false); | ||
152 | }); | ||
153 | return false; | ||
154 | }); | ||
155 | } | ||
156 | |||
145 | void testReadEmptyDb() | 157 | void testReadEmptyDb() |
146 | { | 158 | { |
147 | bool gotResult = false; | 159 | bool gotResult = false; |