From 4141b5e8e6296ca8ab94553e27257f8c2b107461 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 23 Aug 2015 13:02:04 +0200 Subject: Less noise and better error handling. Trying to read from non-existant databases no longer prints error messages. --- tests/genericresourcetest.cpp | 3 --- tests/messagequeuetest.cpp | 2 +- tests/storagetest.cpp | 7 ++++++- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/genericresourcetest.cpp b/tests/genericresourcetest.cpp index 0c5db15..fa6da22 100644 --- a/tests/genericresourcetest.cpp +++ b/tests/genericresourcetest.cpp @@ -44,9 +44,6 @@ private Q_SLOTS: removeFromDisk("org.kde.test.instance1.userqueue"); removeFromDisk("org.kde.test.instance1.synchronizerqueue"); Akonadi2::Log::setDebugOutputLevel(Akonadi2::Log::Trace); - qDebug(); - qDebug() << "-----------------------------------------"; - qDebug(); } void testProcessCommand() diff --git a/tests/messagequeuetest.cpp b/tests/messagequeuetest.cpp index 9c2aa16..22ce161 100644 --- a/tests/messagequeuetest.cpp +++ b/tests/messagequeuetest.cpp @@ -49,7 +49,7 @@ private Q_SLOTS: gotError = true; }); QVERIFY(!gotValue); - QVERIFY(gotError); + QVERIFY(!gotError); } void testEnqueue() diff --git a/tests/storagetest.cpp b/tests/storagetest.cpp index fe80bb7..e872c44 100644 --- a/tests/storagetest.cpp +++ b/tests/storagetest.cpp @@ -159,7 +159,12 @@ private Q_SLOTS: bool gotResult = false; bool gotError = false; Akonadi2::Storage store(testDataPath, dbName, Akonadi2::Storage::ReadWrite); - int numValues = store.createTransaction(Akonadi2::Storage::ReadOnly).scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { + auto transaction = store.createTransaction(Akonadi2::Storage::ReadOnly); + auto db = transaction.openDatabase("default", [&](const Akonadi2::Storage::Error &error) { + qDebug() << error.message; + gotError = true; + }); + int numValues = db.scan("", [&](const QByteArray &key, const QByteArray &value) -> bool { gotResult = true; return false; }, -- cgit v1.2.3