From 66bcbab0990c965196991d66ca2a595cf9135074 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Sat, 6 Dec 2014 00:39:07 +0100 Subject: read takes an error handler rather than returns a bool --- tests/storagebenchmark.cpp | 2 +- tests/storagetest.cpp | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index 6010539..9c95d3b 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp @@ -118,7 +118,7 @@ private Q_SLOTS: { for (int i = 0; i < count; i++) { if (store) { - store->read(keyPrefix + std::to_string(i), [](std::string value){}); + store->read(keyPrefix + std::to_string(i), [](std::string value) -> bool { return true; }); } } } diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index 3981c4b..1974355 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -38,12 +38,16 @@ private: bool success = true; bool keyMatch = true; const auto reference = keyPrefix + std::to_string(i); - success = storage.read(keyPrefix + std::to_string(i), [&keyMatch, &reference](const std::string &value) { - if (value != reference) { - qDebug() << "Mismatch while reading"; - keyMatch = false; - } - }); + storage.read(keyPrefix + std::to_string(i), + [&keyMatch, &reference](const std::string &value) -> bool { + if (value != reference) { + qDebug() << "Mismatch while reading"; + keyMatch = false; + } + return keyMatch; + }, + [&success](const Storage::Error &) { success = false; } + ); return success && keyMatch; } -- cgit v1.2.3