mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-24 18:35:37 +00:00
tests: Use QTRY_COMPARE instead manual timer
This commit is contained in:
parent
54c741844b
commit
7014e86f68
|
@ -179,20 +179,13 @@ void SearchTest::test311232()
|
|||
|
||||
const int searchId = 0;
|
||||
d.searchText(searchId, QStringLiteral(" i "), true, Qt::CaseSensitive, Okular::Document::NextMatch, false, QColor());
|
||||
QTime t;
|
||||
t.start();
|
||||
while (spy.count() != 1 && t.elapsed() < 500)
|
||||
qApp->processEvents();
|
||||
QCOMPARE(spy.count(), 1);
|
||||
QTRY_COMPARE(spy.count(), 1);
|
||||
QCOMPARE(receiver.m_id, searchId);
|
||||
QCOMPARE(receiver.m_status, Okular::Document::MatchFound);
|
||||
|
||||
|
||||
d.continueSearch( searchId, Okular::Document::PreviousMatch );
|
||||
t.start();
|
||||
while (spy.count() != 2 && t.elapsed() < 500)
|
||||
qApp->processEvents();
|
||||
QCOMPARE(spy.count(), 2);
|
||||
QTRY_COMPARE(spy.count(), 2);
|
||||
QCOMPARE(receiver.m_id, searchId);
|
||||
QCOMPARE(receiver.m_status, Okular::Document::NoMatchFound);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue