diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-03-16 18:50:02 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-03-17 14:57:20 (GMT) |
commit | 13f415e7d54ef8e2aaccabfb04f29ccfde0520df (patch) | |
tree | 0d9e3baf35df19e7d28174216117c8561abae47f /tests/auto/qeventloop | |
parent | 6f7076d6fe80f656d8d2f7f1b005dc138b05bef3 (diff) | |
download | Qt-13f415e7d54ef8e2aaccabfb04f29ccfde0520df.zip Qt-13f415e7d54ef8e2aaccabfb04f29ccfde0520df.tar.gz Qt-13f415e7d54ef8e2aaccabfb04f29ccfde0520df.tar.bz2 |
Make tst_QEventLoop::processEventsExcludeSocket stricter
The test was only checking that the socket event is not processed when
excluded. I have added an additional test that a further call with socket
events included results in the deferred socket event being processed.
i.e. makes sure events are deferred to later and not lost.
Also fixed capabilities of the autotest, so this test case can run.
Reviewed-by: Markus Goetz
Diffstat (limited to 'tests/auto/qeventloop')
-rw-r--r-- | tests/auto/qeventloop/qeventloop.pro | 1 | ||||
-rw-r--r-- | tests/auto/qeventloop/tst_qeventloop.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/qeventloop/qeventloop.pro b/tests/auto/qeventloop/qeventloop.pro index f6c24ae..e7489fa 100644 --- a/tests/auto/qeventloop/qeventloop.pro +++ b/tests/auto/qeventloop/qeventloop.pro @@ -5,3 +5,4 @@ QT += network win32:!wince*:LIBS += -luser32 +symbian:TARGET.CAPABILITY += NetworkServices
\ No newline at end of file diff --git a/tests/auto/qeventloop/tst_qeventloop.cpp b/tests/auto/qeventloop/tst_qeventloop.cpp index 6860f19..aad8390 100644 --- a/tests/auto/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/qeventloop/tst_qeventloop.cpp @@ -604,6 +604,7 @@ public slots: serverSocket->flush(); QCoreApplication::processEvents(QEventLoop::ExcludeSocketNotifiers); testResult = dataArrived; + QCoreApplication::processEvents(); //check the deferred event is processed serverSocket->close(); QThread::currentThread()->exit(0); } @@ -620,9 +621,11 @@ public: if (tester->init()) exec(); testResult = tester->testResult; + dataArrived = tester->dataArrived; delete tester; } bool testResult; + bool dataArrived; }; void tst_QEventLoop::processEventsExcludeSocket() @@ -631,6 +634,7 @@ void tst_QEventLoop::processEventsExcludeSocket() thread.start(); QVERIFY(thread.wait()); QVERIFY(!thread.testResult); + QVERIFY(thread.dataArrived); } class TimerReceiver : public QObject |