Skip to content

Commit

Permalink
Fix Qt 5.9 build
Browse files Browse the repository at this point in the history
  • Loading branch information
Waqar144 committed Sep 1, 2023
1 parent f853b5e commit 1295024
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions tests/bindinginspectortest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,9 +1067,7 @@ void BindingInspectorTest::testIntegration()
QCOMPARE(bindingModel->rowCount(aHeightIndex), 0);

delete rect;
QVERIFY(QTest::qWaitFor([bindingModel] {
return bindingModel->rowCount() == 0;
}));
QTRY_VERIFY(bindingModel->rowCount() == 0);
}
#endif

Expand Down
14 changes: 7 additions & 7 deletions tests/remotemodeltest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private slots:
&RemoteModelServer::newRequest);

ModelTest modelTest(&client);
QVERIFY(QTest::qWaitFor([&client] { return client.rowCount() == 4; }));
QTRY_VERIFY(client.rowCount() == 4); // ModelTest is going to fetch stuff for us already

QCOMPARE(client.rowCount(), 4);
QCOMPARE(client.hasChildren(), true);
Expand All @@ -188,15 +188,15 @@ private slots:
QCOMPARE(client.rowCount(index), 0);

listModel->insertRow(1, new QStandardItem(QStringLiteral("entry1")));
QVERIFY(QTest::qWaitFor([&client] { return client.rowCount() == 5; }));
QTRY_VERIFY(client.rowCount() == 5);
QCOMPARE(client.rowCount(), 5);
index = client.index(1, 0);
QVERIFY(waitForData(index));
QCOMPARE(index.data().toString(), QStringLiteral("entry1"));

const auto deleteMe = listModel->takeRow(3);
qDeleteAll(deleteMe);
QVERIFY(QTest::qWaitFor([&client] { return client.rowCount() == 4; }));
QTRY_VERIFY(client.rowCount() == 4);
QCOMPARE(client.rowCount(), 4);
}

Expand All @@ -223,7 +223,7 @@ private slots:
&RemoteModelServer::newRequest);

ModelTest modelTest(&client);
QVERIFY(QTest::qWaitFor([&client] { return client.rowCount() == 2; }));
QTRY_VERIFY(client.rowCount() == 2);

QCOMPARE(client.rowCount(), 2);
QCOMPARE(client.hasChildren(), true);
Expand All @@ -239,7 +239,7 @@ private slots:
QCOMPARE(client.rowCount(i12), 0);

e1->insertRow(1, new QStandardItem(QStringLiteral("entry11")));
QVERIFY(QTest::qWaitFor([&client, i1] { return client.rowCount(i1) == 3; }));
QTRY_VERIFY(client.rowCount(i1) == 3);

QCOMPARE(client.rowCount(i1), 3);
auto i11 = client.index(1, 0, i1);
Expand All @@ -249,7 +249,7 @@ private slots:

const auto deleteMe = e1->takeRow(0);
qDeleteAll(deleteMe);
QVERIFY(QTest::qWaitFor([&client, i1] { return client.rowCount(i1) == 2; }));
QTRY_VERIFY(client.rowCount(i1) == 2);

QCOMPARE(client.rowCount(i1), 2);
i11 = client.index(0, 0, i1);
Expand Down Expand Up @@ -288,7 +288,7 @@ private slots:
proxy.setSourceModel(&client);

ModelTest modelTest(&proxy);
QVERIFY(QTest::qWaitFor([&client] { return client.rowCount() == 2; }));
QTRY_VERIFY(client.rowCount() == 2);

QCOMPARE(client.rowCount(), 2);
QCOMPARE(proxy.rowCount(), 2);
Expand Down

0 comments on commit 1295024

Please sign in to comment.