diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-08-26 20:06:57 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-08-26 20:06:57 +0200 |
commit | afab1546a7665bac2a8d7a6452e6aea46bfd2127 (patch) | |
tree | d616a7559c54a40e35a12b464f606774c9b0475b /tests/auto/network | |
parent | 06b457c693f207e392d3021d77a0ab18cd78da92 (diff) | |
parent | 53ecaade10319ecc1d8115521ae6d8eba1ee55c1 (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
qmake/doc/snippets/code/doc_src_qmake-manual.pro
qmake/doc/src/qmake-manual.qdoc
src/corelib/io/qstorageinfo_unix.cpp
src/corelib/tools/qbytearray.cpp
src/widgets/kernel/qwidgetwindow.cpp
tests/auto/corelib/io/qprocess/tst_qprocess.cpp
tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
tests/auto/network/access/qnetworkreply/BLACKLIST
Change-Id: I9efcd7e1cce1c394eed425c43aa6fce7d2edf31c
Diffstat (limited to 'tests/auto/network')
3 files changed, 37 insertions, 14 deletions
diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST index 7c9b8db3c3..3ec580ddde 100644 --- a/tests/auto/network/access/qnetworkreply/BLACKLIST +++ b/tests/auto/network/access/qnetworkreply/BLACKLIST @@ -1,16 +1,8 @@ osx [ioGetFromBuiltinHttp:http+limited] -osx ubuntu-14.04 [ioGetFromBuiltinHttp:https+limited] -osx ubuntu-14.04 -[ioGetFromHttpBrokenServer:no-newline] -osx -[synchronousRequest:https] -osx -[SslHandshakeFailedError] -osx [httpAbort] * [backgroundRequestInterruption:ftp, bg, nobg] diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 4d41d4beb1..debdc6bcb3 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -1078,7 +1078,7 @@ protected: // clean up QAbstractSocket's residue: while (client->bytesToWrite() > 0) { qDebug() << "Still having" << client->bytesToWrite() << "bytes to write, doing that now"; - if (!client->waitForBytesWritten(2000)) { + if (!client->waitForBytesWritten(10000)) { qDebug() << "ERROR: FastSender:" << client->error() << "cleaning up residue"; return; } @@ -1098,7 +1098,7 @@ protected: measuredSentBytes += writeNextData(client, bytesToWrite); while (client->bytesToWrite() > 0) { - if (!client->waitForBytesWritten(2000)) { + if (!client->waitForBytesWritten(10000)) { qDebug() << "ERROR: FastSender:" << client->error() << "during blocking write"; return; } @@ -8203,7 +8203,7 @@ public slots: m_receivedData += data; if (!m_parsedHeaders && m_receivedData.contains("\r\n\r\n")) { m_parsedHeaders = true; - QTimer::singleShot(qrand()%10, this, SLOT(closeDelayed())); // simulate random network latency + QTimer::singleShot(qrand()%60, this, SLOT(closeDelayed())); // simulate random network latency // This server simulates a web server connection closing, e.g. because of Apaches MaxKeepAliveRequests or KeepAliveTimeout // In this case QNAM needs to re-send the upload data but it had a bug which then corrupts the upload // This test catches that. @@ -8309,11 +8309,12 @@ void tst_QNetworkReply::putWithServerClosingConnectionImmediately() // get the request started and the incoming socket connected QTestEventLoop::instance().enterLoop(10); + QVERIFY(!QTestEventLoop::instance().timeout()); //qDebug() << "correct=" << server.m_correctUploads << "corrupt=" << server.m_corruptUploads << "expected=" <<numUploads; // Sanity check because ecause of 9c2ecf89 most replies will error out but we want to make sure at least some of them worked - QVERIFY(server.m_correctUploads > 5); + QVERIFY(server.m_correctUploads > 2); // Because actually important is that we don't get any corruption: QCOMPARE(server.m_corruptUploads, 0); diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index dc41a93906..2331bc19aa 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -848,7 +848,11 @@ void tst_QUdpSocket::writeDatagramToNonExistingPeer_data() QTest::addColumn<bool>("bind"); QTest::addColumn<QHostAddress>("peerAddress"); QHostAddress localhost(QHostAddress::LocalHost); - QHostAddress remote = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first(); + QList<QHostAddress> serverAddresses(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses()); + if (serverAddresses.isEmpty()) + return; + + QHostAddress remote = serverAddresses.first(); QTest::newRow("localhost-unbound") << false << localhost; QTest::newRow("localhost-bound") << true << localhost; @@ -858,6 +862,8 @@ void tst_QUdpSocket::writeDatagramToNonExistingPeer_data() void tst_QUdpSocket::writeDatagramToNonExistingPeer() { + if (QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().isEmpty()) + QFAIL("Could not find test server address"); QFETCH(bool, bind); QFETCH(QHostAddress, peerAddress); @@ -879,7 +885,11 @@ void tst_QUdpSocket::writeToNonExistingPeer_data() { QTest::addColumn<QHostAddress>("peerAddress"); QHostAddress localhost(QHostAddress::LocalHost); - QHostAddress remote = QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first(); + QList<QHostAddress> serverAddresses(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses()); + if (serverAddresses.isEmpty()) + return; + + QHostAddress remote = serverAddresses.first(); // write (required to be connected) QTest::newRow("localhost") << localhost; QTest::newRow("remote") << remote; @@ -888,6 +898,8 @@ void tst_QUdpSocket::writeToNonExistingPeer_data() void tst_QUdpSocket::writeToNonExistingPeer() { QSKIP("Connected-mode UDP sockets and their behaviour are erratic"); + if (QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().isEmpty()) + QFAIL("Could not find test server address"); QFETCH(QHostAddress, peerAddress); quint16 peerPort = 34534; qRegisterMetaType<QAbstractSocket::SocketError>("QAbstractSocket::SocketError"); @@ -1114,6 +1126,9 @@ void tst_QUdpSocket::multicastTtlOption_data() void tst_QUdpSocket::multicastTtlOption() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support multicast."); +#endif QFETCH_GLOBAL(bool, setProxy); QFETCH(QHostAddress, bindAddress); QFETCH(int, ttl); @@ -1156,6 +1171,9 @@ void tst_QUdpSocket::multicastLoopbackOption_data() void tst_QUdpSocket::multicastLoopbackOption() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support multicast."); +#endif QFETCH_GLOBAL(bool, setProxy); QFETCH(QHostAddress, bindAddress); QFETCH(int, loopback); @@ -1186,6 +1204,9 @@ void tst_QUdpSocket::multicastJoinBeforeBind_data() void tst_QUdpSocket::multicastJoinBeforeBind() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support multicast."); +#endif QFETCH(QHostAddress, groupAddress); QUdpSocket udpSocket; @@ -1206,6 +1227,9 @@ void tst_QUdpSocket::multicastLeaveAfterClose_data() void tst_QUdpSocket::multicastLeaveAfterClose() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support multicast."); +#endif QFETCH_GLOBAL(bool, setProxy); QFETCH(QHostAddress, groupAddress); if (setProxy) @@ -1247,6 +1271,9 @@ void tst_QUdpSocket::setMulticastInterface_data() void tst_QUdpSocket::setMulticastInterface() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support multicast."); +#endif QFETCH_GLOBAL(bool, setProxy); QFETCH(QNetworkInterface, iface); QFETCH(QHostAddress, address); @@ -1295,6 +1322,9 @@ void tst_QUdpSocket::multicast_data() void tst_QUdpSocket::multicast() { +#ifdef Q_OS_WINRT + QSKIP("WinRT does not support multicast."); +#endif QFETCH_GLOBAL(bool, setProxy); QFETCH(QHostAddress, bindAddress); QFETCH(bool, bindResult); |