Minor fixes to the QHttpSocket tests.

This commit is contained in:
Nathan Osman
2015-06-23 18:42:20 -07:00
parent 9f4f152219
commit 4e2d5d1018

View File

@@ -31,7 +31,6 @@
#include "common/qsocketpair.h"
#include "core/qhttpsocket.h"
#include "util/qhttpparser.h"
#include "util/qiodevicecopier.h"
// Utility macro (avoids duplication) that creates a pair of connected
// sockets, a QSimpleHttpClient for the client and a QHttpSocket for the
@@ -99,11 +98,8 @@ void TestQHttpSocket::testData()
client.sendHeaders(Method, Path, headers);
client.sendData(Data);
QBuffer buffer;
QIODeviceCopier copier(&server, &buffer);
copier.start();
QTRY_COMPARE(buffer.data(), Data);
QTRY_COMPARE(server.bytesAvailable(), Data.length());
QCOMPARE(server.readAll(), Data);
server.writeHeaders();
server.write(Data);
@@ -135,7 +131,7 @@ void TestQHttpSocket::testSignals()
server.writeHeaders();
server.write(Data);
QTRY_COMPARE(client.data(), Data);
QTRY_COMPARE(client.data().length(), Data.length());
QVERIFY(bytesWrittenSpy.count() > 0);
qint64 bytesWritten = 0;