diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-06-17 12:21:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-08 23:07:36 +0200 |
commit | 9e2a389fa96821464a00b76b265e8e0887b739a1 (patch) | |
tree | f353051b2897fbb2dfd32cb6b81d5a5474dee183 /tests | |
parent | 10023de7a8e5a90a2be2ddbcf8a659d309b61c97 (diff) |
Rename a few QSignalSpy variables to match what they are spying
Makes for more informative debug output when the tests fail.
Change-Id: Ib07dd79452a56413c711394dd72aa37dbb4a70d7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 25e5f03566..73f8365ce5 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -185,11 +185,11 @@ protected: void tst_QEventLoop::processEvents() { - QSignalSpy spy1(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock())); - QSignalSpy spy2(QAbstractEventDispatcher::instance(), SIGNAL(awake())); + QSignalSpy aboutToBlockSpy(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock())); + QSignalSpy awakeSpy(QAbstractEventDispatcher::instance(), SIGNAL(awake())); - QVERIFY(spy1.isValid()); - QVERIFY(spy2.isValid()); + QVERIFY(aboutToBlockSpy.isValid()); + QVERIFY(awakeSpy.isValid()); QEventLoop eventLoop; @@ -198,8 +198,8 @@ void tst_QEventLoop::processEvents() // process posted events, QEventLoop::processEvents() should return // true QVERIFY(eventLoop.processEvents()); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 1); + QCOMPARE(aboutToBlockSpy.count(), 0); + QCOMPARE(awakeSpy.count(), 1); // allow any session manager to complete its handshake, so that // there are no pending events left. @@ -212,28 +212,28 @@ void tst_QEventLoop::processEvents() // no events to process, QEventLoop::processEvents() should return // false - spy1.clear(); - spy2.clear(); + aboutToBlockSpy.clear(); + awakeSpy.clear(); QVERIFY(!eventLoop.processEvents()); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 1); + QCOMPARE(aboutToBlockSpy.count(), 0); + QCOMPARE(awakeSpy.count(), 1); // make sure the test doesn't block forever int timerId = startTimer(100); // wait for more events to process, QEventLoop::processEvents() // should return true - spy1.clear(); - spy2.clear(); + aboutToBlockSpy.clear(); + awakeSpy.clear(); QVERIFY(eventLoop.processEvents(QEventLoop::WaitForMoreEvents)); // Verify that the eventloop has blocked and woken up. Some eventloops // may block and wake up multiple times. - QVERIFY(spy1.count() > 0); - QVERIFY(spy2.count() > 0); + QVERIFY(aboutToBlockSpy.count() > 0); + QVERIFY(awakeSpy.count() > 0); // We should get one awake for each aboutToBlock, plus one awake when // processEvents is entered. - QVERIFY(spy2.count() >= spy1.count()); + QVERIFY(awakeSpy.count() >= aboutToBlockSpy.count()); killTimer(timerId); } |