diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-03 09:05:08 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-01-03 09:05:08 +0100 |
commit | be33e2c67ec56c7a54680dbce5af6f06281d80e6 (patch) | |
tree | a993fd4ef0ec33b1fd35b576c9d19e1b5a7ddc6f | |
parent | cba59b8cfa941548392ddc52e8e9ff2ec5b9e82e (diff) | |
download | sink-be33e2c67ec56c7a54680dbce5af6f06281d80e6.tar.gz sink-be33e2c67ec56c7a54680dbce5af6f06281d80e6.zip |
Removed broken tests
-rw-r--r-- | common/modelresult.cpp | 8 | ||||
-rw-r--r-- | tests/clientapitest.cpp | 25 |
2 files changed, 2 insertions, 31 deletions
diff --git a/common/modelresult.cpp b/common/modelresult.cpp index e11ec9c..cc5f4ed 100644 --- a/common/modelresult.cpp +++ b/common/modelresult.cpp | |||
@@ -253,14 +253,6 @@ bool ModelResult<T, Ptr>::hasChildren(const QModelIndex &parent) const | |||
253 | if (mQuery.parentProperty().isEmpty() && parent.isValid()) { | 253 | if (mQuery.parentProperty().isEmpty() && parent.isValid()) { |
254 | return false; | 254 | return false; |
255 | } | 255 | } |
256 | // //Figure out whether we have children | ||
257 | // const auto id = parent.internalId(); | ||
258 | // if (!mEntityChildrenFetched.contains(id)) { | ||
259 | // //Since we don't retrieve that information as part of the entity, | ||
260 | // //we have to query for the children to see if we have some | ||
261 | // auto p = const_cast<ModelResult<T, Ptr>*>(this); | ||
262 | // p->fetchMore(parent); | ||
263 | // } | ||
264 | return QAbstractItemModel::hasChildren(parent); | 256 | return QAbstractItemModel::hasChildren(parent); |
265 | } | 257 | } |
266 | 258 | ||
diff --git a/tests/clientapitest.cpp b/tests/clientapitest.cpp index 94818e1..80cf2c4 100644 --- a/tests/clientapitest.cpp +++ b/tests/clientapitest.cpp | |||
@@ -189,32 +189,11 @@ private slots: | |||
189 | query.requestTree("parent"); | 189 | query.requestTree("parent"); |
190 | 190 | ||
191 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); | 191 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); |
192 | QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); | 192 | QTRY_COMPARE(model->rowCount(), 1); |
193 | QCOMPARE(model->rowCount(), 1); | ||
194 | model->fetchMore(model->index(0, 0)); | 193 | model->fetchMore(model->index(0, 0)); |
195 | QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); | 194 | QTRY_COMPARE(model->rowCount(model->index(0, 0)), 1); |
196 | QCOMPARE(model->rowCount(model->index(0, 0)), 1); | ||
197 | } | 195 | } |
198 | 196 | ||
199 | void testModelSignals() | ||
200 | { | ||
201 | auto facade = setupFacade<Sink::ApplicationDomain::Folder>("dummyresource.instance1"); | ||
202 | auto folder = QSharedPointer<Sink::ApplicationDomain::Folder>::create("resource", "id", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
203 | auto subfolder = QSharedPointer<Sink::ApplicationDomain::Folder>::create("resource", "subId", 0, QSharedPointer<Sink::ApplicationDomain::MemoryBufferAdaptor>::create()); | ||
204 | subfolder->setParent("id"); | ||
205 | facade->results << folder << subfolder; | ||
206 | |||
207 | // Test | ||
208 | Sink::Query query; | ||
209 | query.resourceFilter("dummyresource.instance1"); | ||
210 | query.requestTree("parent"); | ||
211 | |||
212 | auto model = Sink::Store::loadModel<Sink::ApplicationDomain::Folder>(query); | ||
213 | QSignalSpy spy(model.data(), SIGNAL(rowsInserted(const QModelIndex &, int, int))); | ||
214 | QVERIFY(spy.isValid()); | ||
215 | model->fetchMore(model->index(0, 0)); | ||
216 | QTRY_VERIFY(spy.count() >= 1); | ||
217 | } | ||
218 | 197 | ||
219 | void testModelNestedLive() | 198 | void testModelNestedLive() |
220 | { | 199 | { |