summaryrefslogtreecommitdiffstats
path: root/store/test
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-05 01:02:51 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2014-12-05 01:02:51 +0100
commit639fc60c100204c87b93112516cf3b3117cfff0d (patch)
tree13d117060319396958002020c613d763a9c2cd3e /store/test
parent894698bd80007447950e045ab5beed8cb4a03f54 (diff)
downloadsink-639fc60c100204c87b93112516cf3b3117cfff0d.tar.gz
sink-639fc60c100204c87b93112516cf3b3117cfff0d.zip
Return false on error during read.
Diffstat (limited to 'store/test')
-rw-r--r--store/test/storagetest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/store/test/storagetest.cpp b/store/test/storagetest.cpp
index 1b105af..dba4f6c 100644
--- a/store/test/storagetest.cpp
+++ b/store/test/storagetest.cpp
@@ -37,12 +37,14 @@ private:
37 { 37 {
38 bool error = false; 38 bool error = false;
39 const auto reference = keyPrefix + std::to_string(i); 39 const auto reference = keyPrefix + std::to_string(i);
40 db.read(keyPrefix + std::to_string(i), [&error, &reference](const std::string &value) { 40 if(!db.read(keyPrefix + std::to_string(i), [&error, &reference](const std::string &value) {
41 if (value != reference) { 41 if (value != reference) {
42 qDebug() << "Mismatch while reading"; 42 qDebug() << "Mismatch while reading";
43 error = true; 43 error = true;
44 } 44 }
45 }); 45 })) {
46 return false;
47 }
46 return !error; 48 return !error;
47 } 49 }
48 50