diff options
Diffstat (limited to 'tests/auto/network')
5 files changed, 54 insertions, 76 deletions
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index f19ce4ac75..4dcce8509c 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -8194,22 +8194,22 @@ struct SameOriginRedirector : MiniHttpServer void tst_QNetworkReply::ioHttpRedirectPolicy_data() { - QTest::addColumn<QNetworkRequest::RedirectsPolicy>("policy"); + QTest::addColumn<QNetworkRequest::RedirectPolicy>("policy"); QTest::addColumn<bool>("ssl"); QTest::addColumn<int>("redirectCount"); QTest::addColumn<int>("statusCode"); - QTest::newRow("manual-nossl") << QNetworkRequest::ManualRedirectsPolicy << false << 0 << 307; - QTest::newRow("manual-ssl") << QNetworkRequest::ManualRedirectsPolicy << true << 0 << 307; - QTest::newRow("nolesssafe-nossl") << QNetworkRequest::NoLessSafeRedirectsPolicy << false << 1 << 200; - QTest::newRow("nolesssafe-ssl") << QNetworkRequest::NoLessSafeRedirectsPolicy << true << 1 << 200; - QTest::newRow("same-origin-nossl") << QNetworkRequest::SameOriginRedirectsPolicy << false << 1 << 200; - QTest::newRow("same-origin-ssl") << QNetworkRequest::SameOriginRedirectsPolicy << true << 1 << 200; + QTest::newRow("manual-nossl") << QNetworkRequest::ManualRedirectPolicy << false << 0 << 307; + QTest::newRow("manual-ssl") << QNetworkRequest::ManualRedirectPolicy << true << 0 << 307; + QTest::newRow("nolesssafe-nossl") << QNetworkRequest::NoLessSafeRedirectPolicy << false << 1 << 200; + QTest::newRow("nolesssafe-ssl") << QNetworkRequest::NoLessSafeRedirectPolicy << true << 1 << 200; + QTest::newRow("same-origin-nossl") << QNetworkRequest::SameOriginRedirectPolicy << false << 1 << 200; + QTest::newRow("same-origin-ssl") << QNetworkRequest::SameOriginRedirectPolicy << true << 1 << 200; } void tst_QNetworkReply::ioHttpRedirectPolicy() { - QFETCH(const QNetworkRequest::RedirectsPolicy, policy); + QFETCH(const QNetworkRequest::RedirectPolicy, policy); QFETCH(const bool, ssl); #ifdef QT_NO_SSL @@ -8234,16 +8234,16 @@ void tst_QNetworkReply::ioHttpRedirectPolicy() redirectServer.responses.push_back(tempRedirectReplyStr().arg(QString(url.toEncoded())).toLatin1()); // This is the default one we preserve between tests. - QCOMPARE(manager.redirectsPolicy(), QNetworkRequest::ManualRedirectsPolicy); + QCOMPARE(manager.redirectPolicy(), QNetworkRequest::ManualRedirectPolicy); - manager.setRedirectsPolicy(policy); - QCOMPARE(manager.redirectsPolicy(), policy); + manager.setRedirectPolicy(policy); + QCOMPARE(manager.redirectPolicy(), policy); QNetworkReplyPtr reply(manager.get(QNetworkRequest(url))); if (ssl) reply->ignoreSslErrors(); // Restore default: - manager.setRedirectsPolicy(QNetworkRequest::ManualRedirectsPolicy); + manager.setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy); QSignalSpy redirectSpy(reply.data(), SIGNAL(redirected(QUrl))); QSignalSpy finishedSpy(reply.data(), SIGNAL(finished())); QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply)); @@ -8254,43 +8254,43 @@ void tst_QNetworkReply::ioHttpRedirectPolicy() void tst_QNetworkReply::ioHttpRedirectPolicyErrors_data() { - QTest::addColumn<QNetworkRequest::RedirectsPolicy>("policy"); + QTest::addColumn<QNetworkRequest::RedirectPolicy>("policy"); QTest::addColumn<bool>("ssl"); QTest::addColumn<QString>("location"); QTest::addColumn<int>("maxRedirects"); QTest::addColumn<QNetworkReply::NetworkError>("expectedError"); // 1. NoLessSafeRedirectsPolicy - QTest::newRow("nolesssafe-nossl-nossl-too-many") << QNetworkRequest::NoLessSafeRedirectsPolicy + QTest::newRow("nolesssafe-nossl-nossl-too-many") << QNetworkRequest::NoLessSafeRedirectPolicy << false << QString("http://localhost:%1") << 0 << QNetworkReply::TooManyRedirectsError; - QTest::newRow("nolesssafe-ssl-ssl-too-many") << QNetworkRequest::NoLessSafeRedirectsPolicy + QTest::newRow("nolesssafe-ssl-ssl-too-many") << QNetworkRequest::NoLessSafeRedirectPolicy << true << QString("https:/localhost:%1") << 0 << QNetworkReply::TooManyRedirectsError; - QTest::newRow("nolesssafe-ssl-nossl-insecure-redirect") << QNetworkRequest::NoLessSafeRedirectsPolicy + QTest::newRow("nolesssafe-ssl-nossl-insecure-redirect") << QNetworkRequest::NoLessSafeRedirectPolicy << true << QString("http://localhost:%1") << 50 << QNetworkReply::InsecureRedirectError; // 2. SameOriginRedirectsPolicy - QTest::newRow("same-origin-nossl-nossl-too-many") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-nossl-nossl-too-many") << QNetworkRequest::SameOriginRedirectPolicy << false << QString("http://localhost:%1") << 0 << QNetworkReply::TooManyRedirectsError; - QTest::newRow("same-origin-ssl-ssl-too-many") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-ssl-ssl-too-many") << QNetworkRequest::SameOriginRedirectPolicy << true << QString("https://localhost:%1") << 0 << QNetworkReply::TooManyRedirectsError; - QTest::newRow("same-origin-https-http-wrong-protocol") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-https-http-wrong-protocol") << QNetworkRequest::SameOriginRedirectPolicy << true << QString("http://localhost:%1") << 50 << QNetworkReply::InsecureRedirectError; - QTest::newRow("same-origin-http-https-wrong-protocol") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-http-https-wrong-protocol") << QNetworkRequest::SameOriginRedirectPolicy << false << QString("https://localhost:%1") << 50 << QNetworkReply::InsecureRedirectError; - QTest::newRow("same-origin-http-http-wrong-host") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-http-http-wrong-host") << QNetworkRequest::SameOriginRedirectPolicy << false << QString("http://not-so-localhost:%1") << 50 << QNetworkReply::InsecureRedirectError; - QTest::newRow("same-origin-https-https-wrong-host") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-https-https-wrong-host") << QNetworkRequest::SameOriginRedirectPolicy << true << QString("https://not-so-localhost:%1") << 50 << QNetworkReply::InsecureRedirectError; - QTest::newRow("same-origin-http-http-wrong-port") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-http-http-wrong-port") << QNetworkRequest::SameOriginRedirectPolicy << false << QString("http://localhost/%1") << 50 << QNetworkReply::InsecureRedirectError; - QTest::newRow("same-origin-https-https-wrong-port") << QNetworkRequest::SameOriginRedirectsPolicy + QTest::newRow("same-origin-https-https-wrong-port") << QNetworkRequest::SameOriginRedirectPolicy << true << QString("https://localhost/%1") << 50 << QNetworkReply::InsecureRedirectError; } void tst_QNetworkReply::ioHttpRedirectPolicyErrors() { - QFETCH(const QNetworkRequest::RedirectsPolicy, policy); + QFETCH(const QNetworkRequest::RedirectPolicy, policy); // This should never happen: - QVERIFY(policy != QNetworkRequest::ManualRedirectsPolicy); + QVERIFY(policy != QNetworkRequest::ManualRedirectPolicy); QFETCH(const bool, ssl); QFETCH(const QString, location); @@ -8317,13 +8317,13 @@ void tst_QNetworkReply::ioHttpRedirectPolicyErrors() request.setMaximumRedirectsAllowed(maxRedirects); // We always reset the policy to the default one ('Manual') after any related // test is finished: - QCOMPARE(manager.redirectsPolicy(), QNetworkRequest::ManualRedirectsPolicy); - manager.setRedirectsPolicy(policy); - QCOMPARE(manager.redirectsPolicy(), policy); + QCOMPARE(manager.redirectPolicy(), QNetworkRequest::ManualRedirectPolicy); + manager.setRedirectPolicy(policy); + QCOMPARE(manager.redirectPolicy(), policy); QNetworkReplyPtr reply(manager.get(request)); // Set it back to default: - manager.setRedirectsPolicy(QNetworkRequest::ManualRedirectsPolicy); + manager.setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy); if (ssl) reply->ignoreSslErrors(); @@ -8358,9 +8358,9 @@ void tst_QNetworkReply::ioHttpUserVerifiedRedirect() redirectServer.setDataToTransmit(tempRedirectReplyStr().arg(QString(url.toEncoded())).toLatin1()); url.setPort(redirectServer.serverPort()); - QCOMPARE(manager.redirectsPolicy(), QNetworkRequest::ManualRedirectsPolicy); - manager.setRedirectsPolicy(QNetworkRequest::UserVerifiedRedirectsPolicy); - QCOMPARE(manager.redirectsPolicy(), QNetworkRequest::UserVerifiedRedirectsPolicy); + QCOMPARE(manager.redirectPolicy(), QNetworkRequest::ManualRedirectPolicy); + manager.setRedirectPolicy(QNetworkRequest::UserVerifiedRedirectPolicy); + QCOMPARE(manager.redirectPolicy(), QNetworkRequest::UserVerifiedRedirectPolicy); QNetworkReplyPtr reply(manager.get(QNetworkRequest(url))); reply->connect(reply.data(), &QNetworkReply::redirected, @@ -8376,8 +8376,8 @@ void tst_QNetworkReply::ioHttpUserVerifiedRedirect() }); // Before any test failed, reset the policy to default: - manager.setRedirectsPolicy(QNetworkRequest::ManualRedirectsPolicy); - QCOMPARE(manager.redirectsPolicy(), QNetworkRequest::ManualRedirectsPolicy); + manager.setRedirectPolicy(QNetworkRequest::ManualRedirectPolicy); + QCOMPARE(manager.redirectPolicy(), QNetworkRequest::ManualRedirectPolicy); QSignalSpy finishedSpy(reply.data(), SIGNAL(finished())); waitForFinish(reply); diff --git a/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp b/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp index 3295580432..5eedd1043b 100644 --- a/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp +++ b/tests/auto/network/kernel/qnetworkdatagram/tst_qnetworkdatagram.cpp @@ -1,9 +1,9 @@ /**************************************************************************** ** ** Copyright (C) 2016 Intel Corporation. -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtNetwork module of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage diff --git a/tests/auto/network/socket/qsctpsocket/tst_qsctpsocket.cpp b/tests/auto/network/socket/qsctpsocket/tst_qsctpsocket.cpp index cf15e60531..89a1430948 100644 --- a/tests/auto/network/socket/qsctpsocket/tst_qsctpsocket.cpp +++ b/tests/auto/network/socket/qsctpsocket/tst_qsctpsocket.cpp @@ -1,31 +1,26 @@ /**************************************************************************** ** ** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL21$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp b/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp index ddf503eed6..60add4a51c 100644 --- a/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp +++ b/tests/auto/network/ssl/qssldiffiehellmanparameters/tst_qssldiffiehellmanparameters.cpp @@ -1,11 +1,11 @@ /**************************************************************************** ** ** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtNetwork module of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,13 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro index 5c92ca833a..4ccf0f24b0 100644 --- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro +++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro @@ -14,12 +14,6 @@ win32 { } } -# OpenSSL support -qtConfig(openssl)|qtConfig(openssl-linked) { - # Add optional SSL libs - LIBS += $$OPENSSL_LIBS -} - DEFINES += SRCDIR=\\\"$$PWD/\\\" requires(qtConfig(private_tests)) |