summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp')
-rw-r--r--tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp67
1 files changed, 31 insertions, 36 deletions
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
index 769a96ac64..d839141091 100644
--- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
+++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2012 Intel Corporation.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 Intel Corporation.
+** 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$
**
@@ -103,7 +98,7 @@ static QByteArray prettyList(const T &items)
first = false;
result += prettyPair(it);
}
- result += ")";
+ result += QLatin1Char(')');
return result.toLocal8Bit();
}
@@ -176,20 +171,20 @@ void tst_QUrlQuery::constructing()
QUrlQuery copy(empty);
QVERIFY(copy.isEmpty());
QVERIFY(!copy.isDetached());
- QVERIFY(copy == empty);
+ QCOMPARE(copy, empty);
QCOMPARE(qHash(copy), qHash(empty));
QVERIFY(!(copy != empty));
copy = empty;
- QVERIFY(copy == empty);
+ QCOMPARE(copy, empty);
copy = QUrlQuery();
- QVERIFY(copy == empty);
+ QCOMPARE(copy, empty);
QCOMPARE(qHash(copy), qHash(empty));
}
{
QUrlQuery copy(emptyQuery());
- QVERIFY(copy == empty);
+ QCOMPARE(copy, empty);
}
QVERIFY(!empty.hasQueryItem("a"));
@@ -214,7 +209,7 @@ void tst_QUrlQuery::constructing()
QVERIFY(!(other == empty));
QUrlQuery copy(other);
- QVERIFY(copy == other);
+ QCOMPARE(copy, other);
copy.clear();
QVERIFY(copy.isEmpty());
@@ -222,7 +217,7 @@ void tst_QUrlQuery::constructing()
copy = other;
QVERIFY(!copy.isEmpty());
- QVERIFY(copy == other);
+ QCOMPARE(copy, other);
copy = QUrlQuery();
QVERIFY(copy.isEmpty());
@@ -298,7 +293,7 @@ void tst_QUrlQuery::addRemove()
QCOMPARE(allItems.at(0).first, QString("a"));
QCOMPARE(allItems.at(0).second, QString("b"));
- QVERIFY(query == original);
+ QCOMPARE(query, original);
QVERIFY(!(query != original));
QCOMPARE(qHash(query), qHash(original));
}
@@ -346,7 +341,7 @@ void tst_QUrlQuery::multiAddRemove()
QVERIFY(query.hasQueryItem("a"));
// returns the first one
- QVERIFY(query.queryItemValue("a") == "b");
+ QCOMPARE(query.queryItemValue("a"), QLatin1String("b"));
// order is the order we set them in
QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c");
@@ -359,9 +354,9 @@ void tst_QUrlQuery::multiAddRemove()
QVERIFY(query.hasQueryItem("A"));
QVERIFY(query.hasQueryItem("a"));
- QVERIFY(query.queryItemValue("a") == "b");
+ QCOMPARE(query.queryItemValue("a"), QLatin1String("b"));
QVERIFY(query.allQueryItemValues("a") == QStringList() << "b" << "c");
- QVERIFY(query.queryItemValue("A") == "B");
+ QCOMPARE(query.queryItemValue("A"), QLatin1String("B"));
QVERIFY(query.allQueryItemValues("A") == QStringList() << "B" << "C");
}
@@ -371,7 +366,7 @@ void tst_QUrlQuery::multiAddRemove()
QVERIFY(query.hasQueryItem("a"));
// it must have removed the first one
- QVERIFY(query.queryItemValue("a") == "c");
+ QCOMPARE(query.queryItemValue("a"), QLatin1String("c"));
}
{
@@ -720,7 +715,7 @@ void tst_QUrlQuery::old_queryItems()
QVERIFY(!url.isEmpty());
QList<QPair<QString, QString> > setItems = url.queryItems();
- QVERIFY(newItems == setItems);
+ QCOMPARE(newItems, setItems);
url.addQueryItem("1", "z");
@@ -746,18 +741,18 @@ void tst_QUrlQuery::old_queryItems()
url.removeAllQueryItems("1");
QVERIFY(!url.hasQueryItem("1"));
- QCOMPARE(url.queryItemValue("4").toLatin1().constData(), "a b");
- QCOMPARE(url.queryItemValue("5").toLatin1().constData(), "&");
- QCOMPARE(url.queryItemValue("tex").toLatin1().constData(), "a + b = c");
- QCOMPARE(url.queryItemValue("foo bar").toLatin1().constData(), "hello world");
+ QCOMPARE(url.queryItemValue("4"), QLatin1String("a b"));
+ QCOMPARE(url.queryItemValue("5"), QLatin1String("&"));
+ QCOMPARE(url.queryItemValue("tex"), QLatin1String("a + b = c"));
+ QCOMPARE(url.queryItemValue("foo bar"), QLatin1String("hello world"));
//url.setUrl("http://www.google.com/search?q=a+b");
url.setQuery("q=a+b");
- QCOMPARE(url.queryItemValue("q"), QString("a+b"));
+ QCOMPARE(url.queryItemValue("q"), QLatin1String("a+b"));
//url.setUrl("http://www.google.com/search?q=a=b"); // invalid, but should be tolerated
url.setQuery("q=a=b");
- QCOMPARE(url.queryItemValue("q"), QString("a=b"));
+ QCOMPARE(url.queryItemValue("q"), QLatin1String("a=b"));
}
void tst_QUrlQuery::old_hasQueryItem_data()