diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-13 16:38:01 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-10-14 08:32:42 +0000 |
commit | f0a559f1c8dcf4b78c11853316919783823ded7a (patch) | |
tree | d5199ce97c70001b7db6cbba4082d8699c90abaf /tests/auto/corelib/io/qurlquery | |
parent | a2a00eb044596f3e3f628b6b20b38a5ba524915c (diff) |
Tests: Use QCOMPARE() with QLatin1String() for QString values.
Prefer QCOMPARE over QVERIFY for equality and use QLatin1String().
Change-Id: If226a0fc7b25be3e6774c7e36ca1e6f99234e5dd
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests/auto/corelib/io/qurlquery')
-rw-r--r-- | tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp index 9a4e020aad..7df085df7c 100644 --- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp +++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp @@ -746,18 +746,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() |