From c2f3b5bae5a32d5b3573ed8256bf45231631751a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 11 Feb 2017 16:57:34 +0100 Subject: Ensure we don't accidentally pick up a dataChanaged signal from the initial fetch. --- tests/querytest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/querytest.cpp b/tests/querytest.cpp index b358621..ac55d0b 100644 --- a/tests/querytest.cpp +++ b/tests/querytest.cpp @@ -785,7 +785,8 @@ private slots: query.request(); auto model = Sink::Store::loadModel(query); - QTRY_COMPARE(model->rowCount(), 1); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); + QCOMPARE(model->rowCount(), 1); QSignalSpy insertedSpy(model.data(), &QAbstractItemModel::rowsInserted); QSignalSpy removedSpy(model.data(), &QAbstractItemModel::rowsRemoved); @@ -887,7 +888,8 @@ private slots: query.request(); auto model = Sink::Store::loadModel(query); - QTRY_COMPARE(model->rowCount(), 1); + QTRY_VERIFY(model->data(QModelIndex(), Sink::Store::ChildrenFetchedRole).toBool()); + QCOMPARE(model->rowCount(), 1); QSignalSpy insertedSpy(model.data(), &QAbstractItemModel::rowsInserted); QSignalSpy removedSpy(model.data(), &QAbstractItemModel::rowsRemoved); -- cgit v1.2.3