Stabilize qguieventloop test.

The test assumed that an event loop can be tested for emptiness
multiple times, which is wrong because an event can be delivered any
time.

Change-Id: Ic44245321eeed2091b640ada2c83d205b83a1cc2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
bb10
Jędrzej Nowacki 2015-09-21 13:49:45 +02:00
parent 493d08aeea
commit a153bb232c
2 changed files with 2 additions and 15 deletions

View File

@ -207,22 +207,11 @@ void tst_QEventLoop::processEvents()
QCOMPARE(awakeSpy.count(), 1);
// allow any session manager to complete its handshake, so that
// there are no pending events left.
// there are no pending events left. This tests that we are able
// to process all events from the queue, otherwise it will hang.
while (eventLoop.processEvents())
;
// On mac we get application started events at this point,
// so process events one more time just to be sure.
eventLoop.processEvents();
// no events to process, QEventLoop::processEvents() should return
// false
aboutToBlockSpy.clear();
awakeSpy.clear();
QVERIFY(!eventLoop.processEvents());
QCOMPARE(aboutToBlockSpy.count(), 0);
QCOMPARE(awakeSpy.count(), 1);
// make sure the test doesn't block forever
int timerId = startTimer(100);

View File

@ -1,2 +0,0 @@
[processEvents]
ubuntu-14.04