Remove some manual qWait and use QTRY_VERIFY instead.

This takes 300ms off the total time for this test.

Change-Id: I230b8a58315797a81579f6a07da282b0dc40637d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Robin Burchell 2014-08-18 15:41:41 +02:00
parent 87bc094611
commit e8012b0405

View File

@ -288,8 +288,7 @@ void tst_QSyntaxHighlighter::highlightOnInit()
cursor.insertText("World"); cursor.insertText("World");
TestHighlighter *hl = new TestHighlighter(doc); TestHighlighter *hl = new TestHighlighter(doc);
QTest::qWait(100); QTRY_VERIFY(hl->highlighted);
QVERIFY(hl->highlighted);
} }
class StateTestHighlighter : public QSyntaxHighlighter class StateTestHighlighter : public QSyntaxHighlighter
@ -328,8 +327,7 @@ void tst_QSyntaxHighlighter::stopHighlightingWhenStateDoesNotChange()
cursor.insertText("changestate"); cursor.insertText("changestate");
StateTestHighlighter *hl = new StateTestHighlighter(doc); StateTestHighlighter *hl = new StateTestHighlighter(doc);
QTest::qWait(100); QTRY_VERIFY(hl->highlighted);
QVERIFY(hl->highlighted);
hl->reset(); hl->reset();
@ -488,8 +486,7 @@ void tst_QSyntaxHighlighter::avoidUnnecessaryRehighlight()
QVERIFY(hl->highlighted); QVERIFY(hl->highlighted);
hl->highlighted = false; hl->highlighted = false;
QTest::qWait(100); QTRY_VERIFY(!hl->highlighted);
QVERIFY(!hl->highlighted);
} }
void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight() void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight()