summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/storagetest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp
index 4c44322..81acc13 100644
--- a/tests/storagetest.cpp
+++ b/tests/storagetest.cpp
@@ -191,14 +191,16 @@ private slots:
191 191
192 // We repeat the test a bunch of times since failing is relatively random 192 // We repeat the test a bunch of times since failing is relatively random
193 for (int tries = 0; tries < 10; tries++) { 193 for (int tries = 0; tries < 10; tries++) {
194 //clearEnv in combination with the bogus db layouts tests the dynamic named db opening as well.
195 Sink::Storage::DataStore::clearEnv();
194 bool error = false; 196 bool error = false;
195 // Try to concurrently read 197 // Try to concurrently read
196 QList<QFuture<void>> futures; 198 QList<QFuture<void>> futures;
197 const int concurrencyLevel = 20; 199 const int concurrencyLevel = 20;
198 for (int num = 0; num < concurrencyLevel; num++) { 200 for (int num = 0; num < concurrencyLevel; num++) {
199 futures << QtConcurrent::run([this, &error]() { 201 futures << QtConcurrent::run([this, &error]() {
200 Sink::Storage::DataStore storage(testDataPath, dbName, Sink::Storage::DataStore::ReadOnly); 202 Sink::Storage::DataStore storage(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadOnly);
201 Sink::Storage::DataStore storage2(testDataPath, dbName + "2", Sink::Storage::DataStore::ReadOnly); 203 Sink::Storage::DataStore storage2(testDataPath, {dbName+ "2", {{"bogus", 0}}}, Sink::Storage::DataStore::ReadOnly);
202 for (int i = 0; i < count; i++) { 204 for (int i = 0; i < count; i++) {
203 if (!verify(storage, i)) { 205 if (!verify(storage, i)) {
204 error = true; 206 error = true;
@@ -757,7 +759,7 @@ private slots:
757 759
758 Sink::Storage::DataStore::clearEnv(); 760 Sink::Storage::DataStore::clearEnv();
759 //Try to read-write dynamic opening of the db. 761 //Try to read-write dynamic opening of the db.
760 //This is the case if we don't have all databases available upon initializatoin and we don't (e.g. because the db hasn't been created yet) 762 //This is the case if we don't have all databases available upon initialization and we don't (e.g. because the db hasn't been created yet)
761 { 763 {
762 // Trick the db into not loading all dbs by passing in a bogus layout. 764 // Trick the db into not loading all dbs by passing in a bogus layout.
763 Sink::Storage::DataStore store(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadWrite); 765 Sink::Storage::DataStore store(testDataPath, {dbName, {{"bogus", 0}}}, Sink::Storage::DataStore::ReadWrite);