summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkreply
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2021-05-13 07:32:10 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2021-05-27 06:41:26 +0200
commit810e755c180212892dbd5a8784ffe9c99258862a (patch)
treefe60a5381fe24b4b3a210404e9dd07873aa2a9de /tests/auto/network/access/qnetworkreply
parent71d242c6d38dad420bc01b14adde433146c02401 (diff)
Fix auto-tests that are fooled by the presence of more than one plugin
It's possible that Qt is built with OpenSSL and some other backend. The ifdefs generated are not mutually exclusive anymore, as it was in the past. So tests should rely on the actual backend they have working at runtime. In the process of fixing the auto-tests, modernized feature #if-ery and some associated compilation issues. Fixes: QTBUG-92875 Change-Id: I2be1b924d506fd36dc4e2c6c9158b5023ff87f32 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/network/access/qnetworkreply')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp149
1 files changed, 74 insertions, 75 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 1e60b5d8c3..69b45ac802 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -69,7 +69,7 @@
#include <QtNetwork/QHttpPart>
#include <QtNetwork/QHttpMultiPart>
#include <QtNetwork/QNetworkProxyQuery>
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
#include <QtNetwork/qsslerror.h>
#include <QtNetwork/qsslconfiguration.h>
#include <QtNetwork/qsslsocket.h>
@@ -101,7 +101,7 @@ Q_DECLARE_METATYPE(QSharedPointer<char>)
#endif
Q_DECLARE_METATYPE(QAuthenticator*)
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
Q_DECLARE_METATYPE(QNetworkProxyQuery)
#endif
@@ -119,7 +119,7 @@ class tst_QNetworkReply: public QObject
{
Q_OBJECT
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
struct ProxyData
{
ProxyData(const QNetworkProxy &p, const QByteArray &t, bool auth)
@@ -128,7 +128,7 @@ class tst_QNetworkReply: public QObject
QNetworkProxy proxy;
bool requiresAuthentication;
};
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
static bool seedCreated;
static QString createUniqueExtension()
@@ -161,7 +161,7 @@ class tst_QNetworkReply: public QObject
QString wronlyFileName;
#endif
QString uniqueExtension;
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
QList<ProxyData> proxies;
#endif
QNetworkAccessManager manager;
@@ -170,10 +170,9 @@ class tst_QNetworkReply: public QObject
QSslConfiguration storedSslConfiguration;
QList<QSslError> storedExpectedSslErrors;
static const QString certsFilePath;
-#endif // QT_CONFIG(ssl)
-
bool isSecureTransport = false;
bool isSchannel = false;
+#endif // QT_CONFIG(ssl)
using QObject::connect;
static bool connect(const QNetworkReplyPtr &ptr, const char *signal, const QObject *receiver, const char *slot, Qt::ConnectionType ct = Qt::AutoConnection)
@@ -201,7 +200,7 @@ public Q_SLOTS:
void pipeliningHelperSlot();
void emitErrorForAllRepliesSlot();
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void sslErrors(QNetworkReply*,const QList<QSslError> &);
void storeSslConfiguration();
void ignoreSslErrorListSlot(QNetworkReply *reply, const QList<QSslError> &);
@@ -234,10 +233,10 @@ private Q_SLOTS:
void getFromHttp();
void getErrors_data();
void getErrors();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void headFromHttp_data();
void headFromHttp();
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void putToFile_data();
void putToFile();
void putToFtp_data();
@@ -256,7 +255,7 @@ private Q_SLOTS:
void postToHttpMultipart_data();
void postToHttpMultipart();
void multipartSkipIndices(); // QTBUG-32534
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void putToHttps_data();
void putToHttps();
void putToHttpsSynchronous_data();
@@ -295,12 +294,12 @@ private Q_SLOTS:
void ioGetFromHttpWithAuth_data();
void ioGetFromHttpWithAuth();
void ioGetFromHttpWithAuthSynchronous();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void ioGetFromHttpWithProxyAuth();
void ioGetFromHttpWithProxyAuthSynchronous();
void ioGetFromHttpWithSocksProxy();
-#endif // !QT_NO_NETWORKPROXY
-#ifndef QT_NO_SSL
+#endif // QT_CONFIG(networkproxy)
+#if QT_CONFIG(ssl)
void ioGetFromHttpsWithSslErrors();
void ioGetFromHttpsWithIgnoreSslErrors();
void ioGetFromHttpsWithSslHandshakeError();
@@ -314,10 +313,10 @@ private Q_SLOTS:
void ioGetFromHttpWithCache_data();
void ioGetFromHttpWithCache();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void ioGetWithManyProxies_data();
void ioGetWithManyProxies();
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void ioPutToFileFromFile_data();
void ioPutToFileFromFile();
@@ -333,12 +332,12 @@ private Q_SLOTS:
void ioPutToHttpFromFile();
void ioPostToHttpFromFile_data();
void ioPostToHttpFromFile();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void ioPostToHttpFromSocket_data();
void ioPostToHttpFromSocket();
void ioPostToHttpFromSocketSynchronous();
void ioPostToHttpFromSocketSynchronous_data();
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void ioPostToHttpFromMiddleOfFileToEnd();
void ioPostToHttpFromMiddleOfFileFiveBytes();
void ioPostToHttpFromMiddleOfQBufferFiveBytes();
@@ -378,13 +377,13 @@ private Q_SLOTS:
void nestedEventLoops();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void httpProxyCommands_data();
void httpProxyCommands();
void httpProxyCommandsSynchronous_data();
void httpProxyCommandsSynchronous();
void proxyChange();
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void authorizationError_data();
void authorizationError();
@@ -398,7 +397,7 @@ private Q_SLOTS:
void httpRecursiveCreation();
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void ioPostToHttpsUploadProgress();
void ignoreSslErrorsList_data();
void ignoreSslErrorsList();
@@ -455,7 +454,7 @@ private Q_SLOTS:
void synchronousRequest_data();
void synchronousRequest();
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void synchronousRequestSslFailure();
#endif
@@ -464,11 +463,11 @@ private Q_SLOTS:
void dontInsertPartialContentIntoTheCache();
void httpUserAgent();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void authenticationCacheAfterCancel_data();
void authenticationCacheAfterCancel();
void authenticationWithDifferentRealm();
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void synchronousAuthenticationCache();
void pipelining();
@@ -504,7 +503,7 @@ private Q_SLOTS:
void ioHttpRedirectCustom();
void ioHttpRedirectWithUploadDevice_data();
void ioHttpRedirectWithUploadDevice();
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void putWithServerClosingConnectionImmediately();
#endif
@@ -554,7 +553,7 @@ static bool validateRedirectedResponseHeaders(QNetworkReplyPtr reply)
&& !reply->header(QNetworkRequest::LocationHeader).isValid();
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
static void setupSslServer(QSslSocket* serverSocket)
{
QString testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath();
@@ -580,7 +579,7 @@ const QString tst_QNetworkReply::certsFilePath = "/certs/qt-test-server-host-net
const QString tst_QNetworkReply::certsFilePath = "/certs/qt-test-server-cacert.pem";
#endif
-#endif // !QT_NO_SSL
+#endif // QT_CONFIG(ssl)
// NOTE: MiniHttpServer has a very limited support of PUT/POST requests! Make
// sure you understand the server's code before PUTting/POSTing data (and
@@ -638,7 +637,7 @@ protected:
void incomingConnection(qintptr socketDescriptor) override
{
//qDebug() << "incomingConnection" << socketDescriptor << "doSsl:" << doSsl << "ipv6:" << ipv6;
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
if (doSsl) {
QSslSocket *serverSocket = new QSslSocket(this);
if (!serverSocket->setSocketDescriptor(socketDescriptor)) {
@@ -699,7 +698,7 @@ private:
}
private slots:
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void slotSslErrors(const QList<QSslError>& errors)
{
QTcpSocket *currentClient = qobject_cast<QTcpSocket *>(sender());
@@ -770,7 +769,7 @@ public:
{ QNetworkCookieJar::setAllCookies(cookieList); }
};
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
class MyProxyFactory: public QNetworkProxyFactory
{
public:
@@ -793,7 +792,7 @@ public:
return toReturn;
}
};
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
class MyMemoryCache: public QAbstractNetworkCache
{
@@ -1006,7 +1005,7 @@ public:
}
virtual void incomingConnection(qintptr socketDescriptor) override
{
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
if (doSsl) {
QSslSocket *serverSocket = new QSslSocket;
serverSocket->setParent(this);
@@ -1022,7 +1021,7 @@ public:
}
private slots:
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void slotSslErrors(const QList<QSslError>& errors)
{
qDebug() << "slotSslErrors" << sslSocket->errorString() << errors;
@@ -1292,7 +1291,7 @@ tst_QNetworkReply::tst_QNetworkReply()
{
qRegisterMetaType<QNetworkReply *>(); // for QSignalSpy
qRegisterMetaType<QAuthenticator *>();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
qRegisterMetaType<QNetworkProxy>();
#endif
@@ -1310,7 +1309,7 @@ tst_QNetworkReply::tst_QNetworkReply()
cookieJar = new MyCookieJar;
manager.setCookieJar(cookieJar);
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
QHostInfo hostInfo = QHostInfo::fromName(QtNetworkSettings::httpProxyServerName());
proxies << ProxyData(QNetworkProxy::NoProxy, "", false);
@@ -1329,13 +1328,13 @@ tst_QNetworkReply::tst_QNetworkReply()
<< ProxyData(QNetworkProxy(QNetworkProxy::Socks5Proxy, socksProxy, 1081),
"+socksauth", true);
} else {
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
fprintf(stderr, "==================================================================\n");
fprintf(stderr, "Proxy could not be looked up. No proxy will be used while testing!\n");
fprintf(stderr, "==================================================================\n");
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
ftpSupported = manager.supportedSchemes().contains("ftp");
}
@@ -1357,7 +1356,7 @@ void tst_QNetworkReply::proxyAuthenticationRequired(const QNetworkProxy &, QAuth
auth->setPassword("password");
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void tst_QNetworkReply::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
{
reply->ignoreSslErrors();
@@ -1579,7 +1578,7 @@ void tst_QNetworkReply::initTestCase()
#endif
QDir::setSearchPaths("testdata", QStringList() << testDataDir);
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
QSslConfiguration::defaultConfiguration().caCertificates(); //preload certificates
#endif
@@ -1608,7 +1607,7 @@ void tst_QNetworkReply::cleanupTestData()
// clear the internal cache
manager.clearAccessCache();
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
manager.setProxy(QNetworkProxy());
#endif
manager.setCache(0);
@@ -1617,7 +1616,7 @@ void tst_QNetworkReply::cleanupTestData()
cookieJar->setAllCookies(QList<QNetworkCookie>());
// disconnect manager signals
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
manager.disconnect(SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -1956,7 +1955,7 @@ void tst_QNetworkReply::getFromHttp()
QCOMPARE(reply->readAll(), reference.readAll());
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::headFromHttp_data()
{
QTest::addColumn<qint64>("referenceSize");
@@ -2045,7 +2044,7 @@ void tst_QNetworkReply::headFromHttp()
if (reply->header(QNetworkRequest::ContentTypeHeader).isValid())
QCOMPARE(reply->header(QNetworkRequest::ContentTypeHeader).toString(), contentType);
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void tst_QNetworkReply::getErrors_data()
{
@@ -2788,7 +2787,7 @@ void tst_QNetworkReply::putToHttpMultipart()
QCOMPARE(replyData, expectedReplyData);
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void tst_QNetworkReply::putToHttps_data()
{
if (isSecureTransport)
@@ -3005,7 +3004,7 @@ void tst_QNetworkReply::postToHttpsMultipart()
QCOMPARE(replyData, expectedReplyData);
}
-#endif // QT_NO_SSL
+#endif // QT_CONFIG(ssl)
void tst_QNetworkReply::deleteFromHttp_data()
{
@@ -3651,7 +3650,7 @@ void tst_QNetworkReply::ioGetFromHttpWithAuthSynchronous()
QCOMPARE(replySync->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 401);
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::ioGetFromHttpWithProxyAuth()
{
// This test sends three requests
@@ -3814,9 +3813,9 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
QCOMPARE(authspy.count(), 0);
}
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void tst_QNetworkReply::ioGetFromHttpsWithSslErrors()
{
QFile reference(testDataDir + "/rfc3252.txt");
@@ -4203,7 +4202,7 @@ void tst_QNetworkReply::ioGetFromHttpWithCache()
QCOMPARE(reply->readAll().constData(), qPrintable(body));
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::ioGetWithManyProxies_data()
{
QTest::addColumn<QList<QNetworkProxy> >("proxyList");
@@ -4264,7 +4263,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
<< QNetworkReply::NoError;
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
// HTTPS with HTTP transparent proxy
proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3129);
@@ -4314,7 +4313,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
<< QNetworkReply::ProxyNotFoundError;
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
// HTTPS with HTTP caching proxy
proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
@@ -4393,7 +4392,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
<< QNetworkReply::NoError;
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
// HTTPS request with HTTP Caching + HTTP transparent
proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
@@ -4437,7 +4436,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
@@ -4446,7 +4445,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
manager.disconnect(SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
@@ -4478,7 +4477,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
QCOMPARE(authspy.count(), 0);
}
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void tst_QNetworkReply::ioPutToFileFromFile_data()
{
@@ -4775,7 +4774,7 @@ void tst_QNetworkReply::ioPostToHttpFromFile()
QCOMPARE(reply->readAll().trimmed(), md5sum(sourceFile.readAll()).toHex());
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::ioPostToHttpFromSocket_data()
{
QTest::addColumn<QByteArray>("data");
@@ -4926,7 +4925,7 @@ void tst_QNetworkReply::ioPostToHttpFromSocketSynchronous()
QCOMPARE(reply->readAll().trimmed(), md5sum(data).toHex());
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
// this tests checks if rewinding the POST-data to some place in the middle
// worked.
@@ -5043,7 +5042,7 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
QCOMPARE(reply->error(), QNetworkReply::ContentReSendError);
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
class SslServer : public QTcpServer
{
Q_OBJECT
@@ -5159,7 +5158,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp_data()
QTest::addColumn<int>("bufferSize");
QTest::newRow("http+unlimited") << false << 0;
QTest::newRow("http+limited") << false << 4096;
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
QTest::newRow("https+unlimited") << true << 0;
QTest::newRow("https+limited") << true << 4096;
#endif
@@ -5919,7 +5918,7 @@ void tst_QNetworkReply::nestedEventLoops()
QCOMPARE(errorspy.count(), 0);
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::httpProxyCommands_data()
{
QTest::addColumn<QUrl>("url");
@@ -5930,7 +5929,7 @@ void tst_QNetworkReply::httpProxyCommands_data()
<< QUrl("http://0.0.0.0:4443/http-request")
<< QByteArray("HTTP/1.0 200 OK\r\nProxy-Connection: close\r\nContent-Length: 1\r\n\r\n1")
<< "GET http://0.0.0.0:4443/http-request HTTP/1.";
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
QTest::newRow("https")
<< QUrl("https://0.0.0.0:4443/https-request")
<< QByteArray("HTTP/1.0 200 Connection Established\r\n\r\n")
@@ -5992,7 +5991,7 @@ void tst_QNetworkReply::httpProxyCommandsSynchronous_data()
{
httpProxyCommands_data();
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
struct QThreadCleanup
{
@@ -6014,7 +6013,7 @@ struct QDeleteLaterCleanup
}
};
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::httpProxyCommandsSynchronous()
{
QFETCH(QUrl, url);
@@ -6104,7 +6103,7 @@ void tst_QNetworkReply::proxyChange()
QVERIFY(int(reply3->error()) > 0);
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
void tst_QNetworkReply::authorizationError_data()
{
@@ -6401,7 +6400,7 @@ void tst_QNetworkReply::httpRecursiveCreation()
QVERIFY(!QTestEventLoop::instance().timeout());
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void tst_QNetworkReply::ignoreSslErrorsList_data()
{
QTest::addColumn<QList<QSslError> >("expectedSslErrors");
@@ -6690,7 +6689,7 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
}
#endif // QT_BUILD_INTERNAL
-#endif // QT_NO_SSL
+#endif // QT_CONFIG(ssl)
void tst_QNetworkReply::getAndThenDeleteObject_data()
{
@@ -7125,7 +7124,7 @@ void tst_QNetworkReply::qtbug4121unknownAuthentication()
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
void tst_QNetworkReply::authenticationCacheAfterCancel_data()
{
QTest::addColumn<QNetworkProxy>("proxy");
@@ -7136,7 +7135,7 @@ void tst_QNetworkReply::authenticationCacheAfterCancel_data()
<< proxies.at(i).proxy
<< proxies.at(i).requiresAuthentication
<< QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfcs-auth/rfc3252.txt");
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
QTest::newRow("https" + proxies.at(i).tag)
<< proxies.at(i).proxy
<< proxies.at(i).requiresAuthentication
@@ -7192,7 +7191,7 @@ void tst_QNetworkReply::authenticationCacheAfterCancel()
QFETCH(bool, proxyAuth);
QFETCH(QUrl, url);
QNetworkAccessManager manager;
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
@@ -7319,7 +7318,7 @@ void tst_QNetworkReply::authenticationWithDifferentRealm()
{
AuthenticationCacheHelper helper;
QNetworkAccessManager manager;
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
@@ -7346,7 +7345,7 @@ void tst_QNetworkReply::authenticationWithDifferentRealm()
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(reply->error(), QNetworkReply::NoError);
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // QT_CONFIG(networkproxy)
class QtBug13431Helper : public QObject
{
@@ -7795,7 +7794,7 @@ void tst_QNetworkReply::synchronousRequest()
QNetworkRequest request(url);
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
// workaround for HTTPS requests: add self-signed server cert to list of CA certs,
// since we cannot react to the sslErrors() signal
// to fix this properly we would need to have an ignoreSslErrors() method in the
@@ -7840,7 +7839,7 @@ void tst_QNetworkReply::synchronousRequest()
reply->deleteLater();
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
void tst_QNetworkReply::synchronousRequestSslFailure()
{
// test that SSL won't be accepted with self-signed certificate,
@@ -8951,7 +8950,7 @@ void tst_QNetworkReply::ioHttpRedirectWithUploadDevice()
}
}
-#ifndef QT_NO_SSL
+#if QT_CONFIG(ssl)
class PutWithServerClosingConnectionImmediatelyHandler: public QObject
{