diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2022-03-30 12:00:00 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2022-04-21 22:25:12 +0200 |
commit | f08fd3c05565f8cb170b0314a891bc1b515196e8 (patch) | |
tree | 4190af2911d85162b2d43c60520ebab9257bb9b8 /tests/auto/network | |
parent | fd803a6d04f9fdda5f8aaf27e0c5351c7f9ce376 (diff) |
tst_QNetworkProxyFactory cleanup genericSystemProxy skipping
Instead of having Q_UNUSED and QSKIP in the test itself, we just skip in
the _data function.
Change-Id: I9da3d3104ec25e2645e5770e6392bd46958da072
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/network')
-rw-r--r-- | tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp index d068c48e39..19ce331d18 100644 --- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp +++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp @@ -256,8 +256,6 @@ void tst_QNetworkProxyFactory::genericSystemProxy() QFETCH(QString, hostName); QFETCH(int, port); -// We can only use the generic system proxy where available: -#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) && !defined(Q_OS_ANDROID) && !QT_CONFIG(libproxy) qputenv(envVar, url); const QList<QNetworkProxy> systemProxy = QNetworkProxyFactory::systemProxyForQuery(); QCOMPARE(systemProxy.size(), 1); @@ -265,18 +263,14 @@ void tst_QNetworkProxyFactory::genericSystemProxy() QCOMPARE(systemProxy.first().hostName(), hostName); QCOMPARE(systemProxy.first().port(), static_cast<quint16>(port)); qunsetenv(envVar); -#else - Q_UNUSED(envVar); - Q_UNUSED(url); - Q_UNUSED(proxyType); - Q_UNUSED(hostName); - Q_UNUSED(port); - QSKIP("Generic system proxy not available on this platform."); -#endif } void tst_QNetworkProxyFactory::genericSystemProxy_data() { + // We can only use the generic system proxy where available: +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) || defined(Q_OS_ANDROID) || QT_CONFIG(libproxy) + QSKIP("Generic system proxy not available on this platform."); +#else QTest::addColumn<QByteArray>("envVar"); QTest::addColumn<QByteArray>("url"); QTest::addColumn<QNetworkProxy::ProxyType>("proxyType"); @@ -289,6 +283,7 @@ void tst_QNetworkProxyFactory::genericSystemProxy_data() << QNetworkProxy::Socks5Proxy << QString("127.0.0.1") << 4242; QTest::newRow("http") << QByteArray("http_proxy") << QByteArray("http://example.com:666") << QNetworkProxy::HttpProxy << QString("example.com") << 666; +#endif } class QSPFQThread : public QThread |