summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-02-08 12:26:09 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-13 22:16:17 +0100
commit3f74aea9bb67bcd2ec463792ee111402f10825d5 (patch)
tree6de93571383c040a5e80e07c7796b12adcf904d6 /tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
parent7bf37d966e062790ff04a51a860a16eb52d46838 (diff)
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>
Diffstat (limited to 'tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp')
0 files changed, 0 insertions, 0 deletions