diff options
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r-- | tests/storagetest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index 7202628..dfb91ec 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp | |||
@@ -487,6 +487,24 @@ private slots: | |||
487 | } | 487 | } |
488 | } | 488 | } |
489 | 489 | ||
490 | void testCopyTransaction() | ||
491 | { | ||
492 | Sink::Storage::DataStore store(testDataPath, dbName, Sink::Storage::DataStore::ReadWrite); | ||
493 | { | ||
494 | auto transaction = store.createTransaction(Sink::Storage::DataStore::ReadWrite); | ||
495 | transaction.openDatabase("a", nullptr, false); | ||
496 | transaction.openDatabase("b", nullptr, false); | ||
497 | transaction.openDatabase("c", nullptr, false); | ||
498 | transaction.commit(); | ||
499 | } | ||
500 | auto transaction = store.createTransaction(Sink::Storage::DataStore::ReadOnly); | ||
501 | for (int i = 0; i < 1000; i++) { | ||
502 | transaction.openDatabase("a", nullptr, false); | ||
503 | transaction.openDatabase("b", nullptr, false); | ||
504 | transaction.openDatabase("c", nullptr, false); | ||
505 | transaction = store.createTransaction(Sink::Storage::DataStore::ReadOnly); | ||
506 | } | ||
507 | } | ||
490 | }; | 508 | }; |
491 | 509 | ||
492 | QTEST_MAIN(StorageTest) | 510 | QTEST_MAIN(StorageTest) |