qt5base-lts/tests/auto/corelib/kernel
Bradley T. Hughes 3f74aea9bb Fix tst_QSocketNotifier on Mac OS X
Socket notifier behavior is very OS-dependent. QtNetwork uses non-
immediately (it will return -1 w/ errno=EINPROGRESS). We have to wait
with select(2) to indicate that the connection is ready, then call
connect(2) again. When this happens, we need another call to select(2)
to get notification on the listening socket so that we can call
accept(2) to complete the connection.

The mixingWithTimers() failure happens due to the test expecting a
single processEvents() call to be able to completely connect a TCP
socket. But as described above, this may not happen. The test should
QTRY_COMPARE() to give the test a chance to let all this happen.

The posixSockets() test can fail due to the same connect() behavior. The
test already has a comment about the write notifier behavior being very
OS dependent. This caused the first enterLoop() to return too early,
before the read notifier fired (which is what the test is checking for,
that the read notifier fired). Move creation of the write notifier to
where we expect it to fire, just before writing to the posix socket.

In the same test, the read notifier inside QTcpSocket may not fire after
the write notifier on the posix socket. Use the waitForReadyRead()
function to give the socket a chance to read the data written to the
posix socket.

Change-Id: I541e6ee9a39a92ce3acf6b9ffee51079febe43e4
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
2012-02-13 22:16:17 +01:00
..
qcoreapplication Make "nmake check" pass for corelib tests in Windows. 2012-02-09 12:52:28 +01:00
qeventdispatcher Test posted events in tst_QEventDispatcher with various flags 2012-02-10 15:22:11 +01:00
qeventloop Add the event loop quitlock feature to QtCore. 2012-01-31 23:22:15 +01:00
qmath Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qmetaobject Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qmetaobjectbuilder Initialize dynamic meta object extradata. 2012-02-08 09:53:23 +01:00
qmetaproperty Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qmetatype Detect incompatibilities in repeated type registration 2012-02-07 09:47:51 +01:00
qmimedata Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qobject Force -fPIE on ELF if Qt is built with reduced relocations 2012-02-10 11:42:31 +01:00
qpointer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qsignalmapper Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qsocketnotifier Fix tst_QSocketNotifier on Mac OS X 2012-02-13 22:16:17 +01:00
qtimer Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qtranslator Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qvariant Introduce Q_DECLARE_OPAQUE_POINTER 2012-02-09 00:32:41 +01:00
qwineventnotifier Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
kernel.pro Add tst_QEventDispatcher to tests/auto/corelib/kernel 2012-02-10 15:21:55 +01:00