summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-03-11 19:53:18 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-07-17 15:49:32 +0000
commit58e4bbc83f4cd9ee2b87eff34403ac52b069aa1f (patch)
tree20d047b9f94b6378600b8b2a184a8b2c0fe3c6be /tests
parent954f0d93976362d29044439e4eaa11d2dff16624 (diff)
tst_QUdpSocket: send two bytes in a datagram
I'm getting an error with WSARecvFrom in nativeBytesAvailable() and I don't know why. The number of bytes obtained is correct and the test works for 2 bytes, so let's use that. The Windows nativeBytesAvailable() function has a comment saying that WSAIoctl sometimes indicates 1 byte available when there's a pending error notification, so that function proceeds to do a WSARecvFrom to peek the number of bytes. Somehow that function in this test is getting a SOCKET_ERROR I can't explain. Change-Id: Ic5b19e556e572a72a9df9a405b1fee3b7efb8b24 Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 8de9987ed1..080f763f54 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -1574,7 +1574,7 @@ void tst_QUdpSocket::readyRead()
QSignalSpy spy(&receiver, SIGNAL(readyRead()));
// send a datagram to that port
- sender.writeDatagram("a", makeNonAny(receiver.localAddress()), port);
+ sender.writeDatagram("aa", makeNonAny(receiver.localAddress()), port);
// wait a little
// if QTBUG-43857 is still going, we'll live-lock on socket notifications from receiver's socket
@@ -1583,8 +1583,8 @@ void tst_QUdpSocket::readyRead()
// make sure only one signal was emitted
QCOMPARE(spy.count(), 1);
QVERIFY(receiver.hasPendingDatagrams());
- QCOMPARE(receiver.bytesAvailable(), qint64(1));
- QCOMPARE(receiver.pendingDatagramSize(), qint64(1));
+ QCOMPARE(receiver.bytesAvailable(), qint64(2));
+ QCOMPARE(receiver.pendingDatagramSize(), qint64(2));
// write another datagram
sender.writeDatagram("ab", makeNonAny(receiver.localAddress()), port);
@@ -1594,7 +1594,7 @@ void tst_QUdpSocket::readyRead()
QCOMPARE(spy.count(), 1);
QVERIFY(receiver.hasPendingDatagrams());
QVERIFY(receiver.bytesAvailable() >= 1); // most likely is 1, but it could be 1 + 2 in the future
- QCOMPARE(receiver.pendingDatagramSize(), qint64(1));
+ QCOMPARE(receiver.pendingDatagramSize(), qint64(2));
// read all the datagrams (we could read one only, but we can't be sure the OS is queueing)
while (receiver.hasPendingDatagrams())