void proxy2();
void proxy3();
void postAuthNtlm();
+#ifndef QT_NO_OPENSSL
void proxyAndSsl();
void cachingProxyAndSsl();
+#endif
void reconnect();
void setSocket();
void unexpectedRemoteClose();
QVERIFY(!QTestEventLoop::instance().timeout());
};
+#ifndef QT_NO_OPENSSL
void tst_QHttp::proxyAndSsl()
{
-#ifdef QT_NO_OPENSSL
- QSKIP("No OpenSSL support in this platform", SkipAll);
-#else
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return;
QHttpResponseHeader header = http.lastResponse();
QVERIFY(header.isValid());
QVERIFY(header.statusCode() < 400); // Should be 200, but as long as it's not an error, we're happy
-#endif
}
+#endif
+#ifndef QT_NO_OPENSSL
void tst_QHttp::cachingProxyAndSsl()
{
-#ifdef QT_NO_OPENSSL
- QSKIP("No OpenSSL support in this platform", SkipAll);
-#else
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return;
QHttpResponseHeader header = http.lastResponse();
QVERIFY(!header.isValid());
-#endif
}
+#endif
void tst_QHttp::emptyBodyInReply()
{
void setCookiesFromUrl();
void cookiesForUrl_data();
void cookiesForUrl();
+#ifdef QT_BUILD_INTERNAL
void effectiveTLDs_data();
void effectiveTLDs();
+#endif
};
QT_BEGIN_NAMESPACE
QCOMPARE(result, expectedResult);
}
+// This test requires private API.
+#ifdef QT_BUILD_INTERNAL
void tst_QNetworkCookieJar::effectiveTLDs_data()
{
QTest::addColumn<QString>("domain");
void tst_QNetworkCookieJar::effectiveTLDs()
{
-#ifndef QT_BUILD_INTERNAL
- QSKIP("Test requires private API", SkipAll);
-#endif
QFETCH(QString, domain);
QFETCH(bool, isTLD);
QCOMPARE(qIsEffectiveTLD(domain), isTLD);
}
+#endif
QTEST_MAIN(tst_QNetworkCookieJar)
#include "tst_qnetworkcookiejar.moc"
void ioPutToFileFromSocket();
void ioPutToFileFromLocalSocket_data();
void ioPutToFileFromLocalSocket();
+#if !defined(QT_NO_PROCESS) && !defined(Q_OS_WINCE)
void ioPutToFileFromProcess_data();
void ioPutToFileFromProcess();
+#endif
void ioPutToFtpFromFile_data();
void ioPutToFtpFromFile();
void ioPutToHttpFromFile_data();
QCOMPARE(contents, data);
}
+// Currently no stdin/out supported for Windows CE.
+#if !defined(QT_NO_PROCESS) && !defined(Q_OS_WINCE)
void tst_QNetworkReply::ioPutToFileFromProcess_data()
{
putToFile_data();
void tst_QNetworkReply::ioPutToFileFromProcess()
{
-#if defined(Q_OS_WINCE)
- QSKIP("Currently no stdin/out supported for Windows CE", SkipAll);
-#else
-
#ifdef Q_OS_WIN
if (qstrcmp(QTest::currentDataTag(), "small") == 0)
QSKIP("When passing a CR-LF-LF sequence through Windows stdio, it gets converted, "
"so this test fails. Disabled on Windows", SkipSingle);
#endif
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
-#else
QFile file(testFileName);
QUrl url = QUrl::fromLocalFile(file.fileName());
QCOMPARE(file.size(), qint64(data.size()));
QByteArray contents = file.readAll();
QCOMPARE(contents, data);
-#endif
-#endif
}
+#endif
void tst_QNetworkReply::ioPutToFtpFromFile_data()
{
void simpleConnectToIMAP();
void udpLoopbackTest();
void udpIPv6LoopbackTest();
+#ifndef Q_OS_AIX
void broadcastTest();
+#endif
void serverTest();
void udpLoopbackPerformance();
void tcpLoopbackPerformance();
void setSocketDescriptor();
void invalidSend();
void receiveUrgentData();
+#ifndef Q_OS_WIN
void tooManySockets();
+#endif
};
tst_PlatformSocketEngine::tst_PlatformSocketEngine()
}
//---------------------------------------------------------------------------
+
+#ifndef Q_OS_AIX
void tst_PlatformSocketEngine::broadcastTest()
{
-#ifdef Q_OS_AIX
- QSKIP("Broadcast does not work on darko", SkipAll);
-#endif
PLATFORMSOCKETENGINE broadcastSocket;
// Initialize a regular Udp socket
QVERIFY(broadcastSocket.readDatagram(response.data(), response.size())
== response.size());
QCOMPARE(response, trollMessage);
-
}
+#endif
//---------------------------------------------------------------------------
void tst_PlatformSocketEngine::serverTest()
}
//---------------------------------------------------------------------------
+
+// Certain windows machines suffocate and spend too much time in this test.
+#ifndef Q_OS_WIN
void tst_PlatformSocketEngine::tooManySockets()
{
-#if defined Q_OS_WIN
- QSKIP("Certain windows machines suffocate and spend too much time in this test.", SkipAll);
-#endif
QList<PLATFORMSOCKETENGINE *> sockets;
PLATFORMSOCKETENGINE *socketLayer = 0;
for (;;) {
qDeleteAll(sockets);
}
+#endif
//---------------------------------------------------------------------------
void tst_PlatformSocketEngine::bind()
void threadedConnection_data();
void threadedConnection();
+#ifndef QT_NO_PROCESS
void processConnection_data();
void processConnection();
+#endif
void longPath();
void waitForDisconnect();
}
}
+#ifndef QT_NO_PROCESS
void tst_QLocalSocket::processConnection_data()
{
QTest::addColumn<int>("processes");
*/
void tst_QLocalSocket::processConnection()
{
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
-#else
QFETCH(int, processes);
QStringList serverArguments = QStringList() << SRCDIR "lackey/scripts/server.js" << QString::number(processes);
QProcess producer;
delete consumer;
}
producer.waitForFinished(15000);
-#endif
}
+#endif
void tst_QLocalSocket::longPath()
{
void waitForConnectionTest();
void setSocketDescriptor();
void listenWhileListening();
+#ifndef QT_NO_PROCESS
void addressReusable();
+#endif
void setNewSocketDescriptorBlocking();
void invalidProxy_data();
void invalidProxy();
}
};
+#ifndef QT_NO_PROCESS
void tst_QTcpServer::addressReusable()
{
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
-#else
-
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
QFETCH_GLOBAL(int, proxyType);
QTcpServer server;
QVERIFY(server.listen(QHostAddress::LocalHost, 49199));
-#endif
}
+#endif
void tst_QTcpServer::setNewSocketDescriptorBlocking()
{
void socketsInThreads();
void waitForReadyReadInASlot();
void remoteCloseError();
+#ifndef Q_OS_VXWORKS
void openMessageBoxInErrorSlot();
+#endif
#ifndef Q_OS_WIN
void connectToLocalHostNoService();
#endif
void waitForConnectedInHostLookupSlot();
+#if !defined(Q_OS_WIN) && !defined(Q_OS_VXWORKS)
void waitForConnectedInHostLookupSlot2();
+#endif
void readyReadSignalsAfterWaitForReadyRead();
#ifdef Q_OS_LINUX
void linuxKernelBugLocalSocket();
void connectionRefused();
void suddenRemoteDisconnect_data();
void suddenRemoteDisconnect();
+#ifndef Q_OS_VXWORKS
void connectToMultiIP();
+#endif
void moveToThread0();
void increaseReadBufferSize();
void taskQtBug5799ConnectionErrorWaitForConnected();
void downloadBigFileSlot();
void recursiveReadyReadSlot();
void waitForReadyReadInASlotSlot();
+#ifndef Q_OS_VXWORKS
void messageBoxSlot();
+#endif
void hostLookupSlot();
void abortiveClose_abortSlot();
void remoteCloseErrorSlot();
static_cast<QTcpSocket *>(sender())->close();
}
+// VxWorks has no default gui
+#ifndef Q_OS_VXWORKS
void tst_QTcpSocket::messageBoxSlot()
{
-#if !defined(Q_OS_VXWORKS) // no gui
QTcpSocket *socket = qobject_cast<QTcpSocket *>(sender());
socket->deleteLater();
QMessageBox box;
// Fire a non-0 singleshot to leave time for the delete
QTimer::singleShot(250, this, SLOT(exitLoopSlot()));
-#endif
}
+#endif
+
//----------------------------------------------------------------------------------
+
+// VxWorks has no default gui
+#ifndef Q_OS_VXWORKS
void tst_QTcpSocket::openMessageBoxInErrorSlot()
{
-#if defined(Q_OS_VXWORKS) // no gui
- QSKIP("no default gui available on VxWorks", SkipAll);
-#else
QTcpSocket *socket = newSocket();
QPointer<QTcpSocket> p(socket);
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(messageBoxSlot()));
socket->connectToHost("hostnotfoundhostnotfound.troll.no", 9999); // Host not found, fyi
enterLoop(30);
QVERIFY(!p);
-#endif
}
+#endif
//----------------------------------------------------------------------------------
#ifndef Q_OS_WIN
};
//----------------------------------------------------------------------------------
+
+#if !defined(Q_OS_WIN) && !defined(Q_OS_VXWORKS)
void tst_QTcpSocket::waitForConnectedInHostLookupSlot2()
{
-#if defined(Q_OS_WIN) || defined(Q_OS_VXWORKS)
- QSKIP("waitForConnectedInHostLookupSlot2 is not run on Windows and VxWorks", SkipAll);
-#else
-
Foo foo;
QPushButton top("Go", 0);
top.show();
QVERIFY(foo.attemptedToConnect);
QCOMPARE(foo.count, 1);
-#endif
}
+#endif
//----------------------------------------------------------------------------------
void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead()
}
//----------------------------------------------------------------------------------
+
+// VxSim in standard config doesn't even run a DNS resolver.
+#ifndef Q_OS_VXWORKS
void tst_QTcpSocket::connectToMultiIP()
{
QSKIP("TODO: setup DNS in the new network", SkipAll);
-#if defined(Q_OS_VXWORKS)
- QSKIP("VxSim in standard config doesn't even run a DNS resolver", SkipAll);
-#else
QFETCH_GLOBAL(bool, ssl);
if (ssl)
return;
QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError);
delete socket;
-#endif
}
+#endif
//----------------------------------------------------------------------------------
void tst_QTcpSocket::moveToThread0()
private slots:
void constructing();
void unconnectedServerAndClientTest();
+#ifndef Q_OS_AIX
void broadcasting();
+#endif
void loop_data();
void loop();
void ipv6Loop_data();
void writeDatagramToNonExistingPeer();
void writeToNonExistingPeer_data();
void writeToNonExistingPeer();
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void outOfProcessConnectedClientServerTest();
void outOfProcessUnconnectedClientServerTest();
+#endif
void zeroLengthDatagram();
void multicastTtlOption_data();
void multicastTtlOption();
//----------------------------------------------------------------------------------
+#ifndef Q_OS_AIX
void tst_QUdpSocket::broadcasting()
{
QFETCH_GLOBAL(bool, setProxy);
QSKIP("With socks5 Broadcast is not supported.", SkipSingle);
}
}
-#ifdef Q_OS_AIX
- QSKIP("Broadcast does not work on darko", SkipAll);
-#endif
const char *message[] = {"Yo mista", "", "Yo", "Wassap"};
QList<QHostAddress> broadcastAddresses;
}
}
}
+#endif
//----------------------------------------------------------------------------------
QCOMPARE(int(sConnected.state()), int(QUdpSocket::ConnectedState));
}
+// This test depends on reading data from QProcess (not supported on Qt/WinCE).
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void tst_QUdpSocket::outOfProcessConnectedClientServerTest()
{
-#if defined(Q_OS_WINCE)
- QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE).", SkipAll);
-#endif
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
-#else
-
QProcess serverProcess;
serverProcess.start(QLatin1String("clientserver/clientserver server 1 1"),
QIODevice::ReadWrite | QIODevice::Text);
QVERIFY(clientProcess.waitForFinished());
serverProcess.kill();
QVERIFY(serverProcess.waitForFinished());
-#endif
}
+#endif
+// This test depends on reading data from QProcess (not supported on Qt/WinCE).
+#if !defined(Q_OS_WINCE) && !defined(QT_NO_PROCESS)
void tst_QUdpSocket::outOfProcessUnconnectedClientServerTest()
{
-#if defined(Q_OS_WINCE)
- QSKIP("This test depends on reading data from QProcess (not supported on Qt/WinCE).", SkipAll);
-#endif
-#if defined(QT_NO_PROCESS)
- QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll);
-#else
-
QProcess serverProcess;
serverProcess.start(QLatin1String("clientserver/clientserver server 1 1"),
QIODevice::ReadWrite | QIODevice::Text);
QVERIFY(clientProcess.waitForFinished());
serverProcess.kill();
QVERIFY(serverProcess.waitForFinished());
-#endif
}
+#endif
void tst_QUdpSocket::zeroLengthDatagram()
{