From be33e2c67ec56c7a54680dbce5af6f06281d80e6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 3 Jan 2018 09:05:08 +0100 Subject: Removed broken tests --- common/modelresult.cpp | 8 -------- 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::hasChildren(const QModelIndex &parent) const if (mQuery.parentProperty().isEmpty() && parent.isValid()) { return false; } - // //Figure out whether we have children - // const auto id = parent.internalId(); - // if (!mEntityChildrenFetched.contains(id)) { - // //Since we don't retrieve that information as part of the entity, - // //we have to query for the children to see if we have some - // auto p = const_cast*>(this); - // p->fetchMore(parent); - // } return QAbstractItemModel::hasChildren(parent); } 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: query.requestTree("parent"); auto model = Sink::Store::loadModel(query); - QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); - QCOMPARE(model->rowCount(), 1); + QTRY_COMPARE(model->rowCount(), 1); model->fetchMore(model->index(0, 0)); - QTRY_VERIFY(model->data(model->index(0, 0), Sink::Store::ChildrenFetchedRole).toBool()); - QCOMPARE(model->rowCount(model->index(0, 0)), 1); + QTRY_COMPARE(model->rowCount(model->index(0, 0)), 1); } - void testModelSignals() - { - auto facade = setupFacade("dummyresource.instance1"); - auto folder = QSharedPointer::create("resource", "id", 0, QSharedPointer::create()); - auto subfolder = QSharedPointer::create("resource", "subId", 0, QSharedPointer::create()); - subfolder->setParent("id"); - facade->results << folder << subfolder; - - // Test - Sink::Query query; - query.resourceFilter("dummyresource.instance1"); - query.requestTree("parent"); - - auto model = Sink::Store::loadModel(query); - QSignalSpy spy(model.data(), SIGNAL(rowsInserted(const QModelIndex &, int, int))); - QVERIFY(spy.isValid()); - model->fetchMore(model->index(0, 0)); - QTRY_VERIFY(spy.count() >= 1); - } void testModelNestedLive() { -- cgit v1.2.3