diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-01 16:22:55 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-01 16:22:55 +0200 |
commit | 096d14f20f4dc39d20d35d605ca755b66bd48cf9 (patch) | |
tree | 4b28dd3b310ebcfa9cefa1b41992eeefa5456764 /tests/clientapitest.cpp | |
parent | c1475df297975b403d991f69ef9436cd576c1e46 (diff) | |
download | sink-096d14f20f4dc39d20d35d605ca755b66bd48cf9.tar.gz sink-096d14f20f4dc39d20d35d605ca755b66bd48cf9.zip |
Account filter for resources and contains comparator in query
Diffstat (limited to 'tests/clientapitest.cpp')
-rw-r--r-- | tests/clientapitest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 172232f..96982ca 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp | |||
@@ -58,7 +58,7 @@ public: | |||
58 | } | 58 | } |
59 | Trace() << "-------------------------."; | 59 | Trace() << "-------------------------."; |
60 | for (const auto &res : results) { | 60 | for (const auto &res : results) { |
61 | qDebug() << "Parent filter " << query.propertyFilter.value("parent").toByteArray() << res->identifier() << res->getProperty("parent").toByteArray(); | 61 | qDebug() << "Parent filter " << query.propertyFilter.value("parent").value.toByteArray() << res->identifier() << res->getProperty("parent").toByteArray(); |
62 | auto parentProperty = res->getProperty("parent").toByteArray(); | 62 | auto parentProperty = res->getProperty("parent").toByteArray(); |
63 | if ((!parent && parentProperty.isEmpty()) || (parent && parentProperty == parent->identifier()) || query.parentProperty.isEmpty()) { | 63 | if ((!parent && parentProperty.isEmpty()) || (parent && parentProperty == parent->identifier()) || query.parentProperty.isEmpty()) { |
64 | qDebug() << "Found a hit" << res->identifier(); | 64 | qDebug() << "Found a hit" << res->identifier(); |
@@ -132,7 +132,7 @@ private slots: | |||
132 | Sink::Store::create(res).exec().waitForFinished(); | 132 | Sink::Store::create(res).exec().waitForFinished(); |
133 | { | 133 | { |
134 | Sink::Query query; | 134 | Sink::Query query; |
135 | query.propertyFilter.insert("type", "dummyresource"); | 135 | query.propertyFilter.insert("type", Sink::Query::Comparator("dummyresource")); |
136 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::SinkResource>(query); | 136 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::SinkResource>(query); |
137 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); | 137 | QTRY_COMPARE(model->rowCount(QModelIndex()), 1); |
138 | } | 138 | } |
@@ -140,7 +140,7 @@ private slots: | |||
140 | Sink::Store::remove(res).exec().waitForFinished(); | 140 | Sink::Store::remove(res).exec().waitForFinished(); |
141 | { | 141 | { |
142 | Sink::Query query; | 142 | Sink::Query query; |
143 | query.propertyFilter.insert("type", "dummyresource"); | 143 | query.propertyFilter.insert("type", Sink::Query::Comparator("dummyresource")); |
144 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::SinkResource>(query); | 144 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::SinkResource>(query); |
145 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 145 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); |
146 | QCOMPARE(model->rowCount(QModelIndex()), 0); | 146 | QCOMPARE(model->rowCount(QModelIndex()), 0); |