summaryrefslogtreecommitdiffstats
path: root/tests/clientapitest.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-07 22:23:49 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-07 22:23:49 +0200
commitda2b049e248c1ad7efeb53685158a205335e4e36 (patch)
tree1e7e5e940e9b760b2108081b1d2f3879cebdb0ff /tests/clientapitest.cpp
parent9bcb822963fc96c94dbe7dcc4134dcd2dac454ff (diff)
downloadsink-da2b049e248c1ad7efeb53685158a205335e4e36.tar.gz
sink-da2b049e248c1ad7efeb53685158a205335e4e36.zip
A new debug system.
Instead of a single #define as debug area the new system allows for an identifier for each debug message with the structure component.area. The component is a dot separated identifier of the runtime component, such as the process or the plugin. The area is the code component, and can be as such defined at compiletime. The idea of this system is that it becomes possible to i.e. look at the output of all messages in the query subsystem of a specific resource (something that happens in the client process, but in the resource-specific subcomponent). The new macros are supposed to be less likely to clash with other names, hence the new names.
Diffstat (limited to 'tests/clientapitest.cpp')
-rw-r--r--tests/clientapitest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp
index 8c5866d..ec74cbd 100644
--- a/tests/clientapitest.cpp
+++ b/tests/clientapitest.cpp
@@ -9,6 +9,8 @@
9#include "resultprovider.h" 9#include "resultprovider.h"
10#include "facadefactory.h" 10#include "facadefactory.h"
11 11
12SINK_DEBUG_AREA("clientapitest")
13
12template <typename T> 14template <typename T>
13class TestDummyResourceFacade : public Sink::StoreFacade<T> 15class TestDummyResourceFacade : public Sink::StoreFacade<T>
14{ 16{
@@ -44,7 +46,7 @@ public:
44 { 46 {
45 auto resultProvider = new Sink::ResultProvider<typename T::Ptr>(); 47 auto resultProvider = new Sink::ResultProvider<typename T::Ptr>();
46 resultProvider->onDone([resultProvider]() { 48 resultProvider->onDone([resultProvider]() {
47 Trace() << "Result provider is done"; 49 SinkTrace() << "Result provider is done";
48 delete resultProvider; 50 delete resultProvider;
49 }); 51 });
50 // We have to do it this way, otherwise we're not setting the fetcher right 52 // We have to do it this way, otherwise we're not setting the fetcher right
@@ -52,11 +54,11 @@ public:
52 54
53 resultProvider->setFetcher([query, resultProvider, this](const typename T::Ptr &parent) { 55 resultProvider->setFetcher([query, resultProvider, this](const typename T::Ptr &parent) {
54 if (parent) { 56 if (parent) {
55 Trace() << "Running the fetcher " << parent->identifier(); 57 SinkTrace() << "Running the fetcher " << parent->identifier();
56 } else { 58 } else {
57 Trace() << "Running the fetcher."; 59 SinkTrace() << "Running the fetcher.";
58 } 60 }
59 Trace() << "-------------------------."; 61 SinkTrace() << "-------------------------.";
60 for (const auto &res : results) { 62 for (const auto &res : results) {
61 qDebug() << "Parent filter " << query.propertyFilter.value("parent").value.toByteArray() << res->identifier() << res->getProperty("parent").toByteArray(); 63 qDebug() << "Parent filter " << query.propertyFilter.value("parent").value.toByteArray() << res->identifier() << res->getProperty("parent").toByteArray();
62 auto parentProperty = res->getProperty("parent").toByteArray(); 64 auto parentProperty = res->getProperty("parent").toByteArray();