summaryrefslogtreecommitdiffstats
path: root/tests/storagetest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/storagetest.cpp')
-rw-r--r--tests/storagetest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp
index b3313c0..3c20135 100644
--- a/tests/storagetest.cpp
+++ b/tests/storagetest.cpp
@@ -126,15 +126,16 @@ private Q_SLOTS:
126 126
127 populate(count); 127 populate(count);
128 128
129 bool error = false;
129 //Try to concurrently read 130 //Try to concurrently read
130 QList<QFuture<void> > futures; 131 QList<QFuture<void> > futures;
131 const int concurrencyLevel = 4; 132 const int concurrencyLevel = 10;
132 for (int num = 0; num < concurrencyLevel; num++) { 133 for (int num = 0; num < concurrencyLevel; num++) {
133 futures << QtConcurrent::run([this, count](){ 134 futures << QtConcurrent::run([this, count, &error](){
134 Storage storage(testDataPath, dbName); 135 Storage storage(testDataPath, dbName);
135 for (int i = 0; i < count; i++) { 136 for (int i = 0; i < count; i++) {
136 if (!verify(storage, i)) { 137 if (!verify(storage, i)) {
137 qWarning() << "invalid value"; 138 error = true;
138 break; 139 break;
139 } 140 }
140 } 141 }
@@ -143,6 +144,7 @@ private Q_SLOTS:
143 for(auto future : futures) { 144 for(auto future : futures) {
144 future.waitForFinished(); 145 future.waitForFinished();
145 } 146 }
147 QVERIFY(!error);
146 148
147 Storage storage(testDataPath, dbName); 149 Storage storage(testDataPath, dbName);
148 storage.removeFromDisk(); 150 storage.removeFromDisk();