From 0097d2daba0d4482090705dee6465faa0967b7d1 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 18 Nov 2011 13:45:33 +1000 Subject: Removed commented test data from QUrl test. The removed test data is invalid for the toString() test function -- QUrl::toString() won't eliminate relative paths from URL's, you need to call QUrl::resolved() to do that. Add this test data to the test for QUrl::resolved(), as the existing tests don't seem to cover the case of a complete URL containing a relative path. Change-Id: Idb0f4eac9cc75258a8e17f10fa95ddb75f01d470 Reviewed-by: Thiago Macieira --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tests/auto/corelib/io/qurl/tst_qurl.cpp') diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index b435d440b7..c5e4d87908 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -878,12 +878,6 @@ void tst_QUrl::toString_data() << uint(QUrl::None) << QString::fromLatin1("http://andreas:hemmelig@www.vg.no/?my=query&your=query#yougotfragged"); - /* - QTest::newRow("data19") << QString::fromLatin1("http://andreas:hemmelig@www.vg.no/a/../?my=query&your=query#yougotfragged") - << uint(QUrl::None) - << QString::fromLatin1("http://andreas:hemmelig@www.vg.no/?my=query&your=query#yougotfragged"); - */ - QTest::newRow("nopath_task31320") << QString::fromLatin1("host://protocol") << uint(QUrl::None) << QString::fromLatin1("host://protocol"); @@ -3200,7 +3194,6 @@ void tst_QUrl::resolvedWithAbsoluteSchemes_data() const << QUrl::fromEncoded("http://example.com/") << QUrl::fromEncoded("http://example.com/"); - QTest::newRow("Absolute file:/// against data scheme.") << QUrl::fromEncoded("file:///foo/") << QUrl::fromEncoded("data:application/xml,%3Ce%2F%3E") @@ -3210,6 +3203,11 @@ void tst_QUrl::resolvedWithAbsoluteSchemes_data() const << QUrl::fromEncoded("http://www.foo.com:8080/") << QUrl::fromEncoded("newfile.html") << QUrl::fromEncoded("http://www.foo.com:8080/newfile.html"); + + QTest::newRow("Resolve with relative path") + << QUrl::fromEncoded("http://example.com/") + << QUrl::fromEncoded("http://andreas:hemmelig@www.vg.no/a/../?my=query&your=query#yougotfragged") + << QUrl::fromEncoded("http://andreas:hemmelig@www.vg.no/?my=query&your=query#yougotfragged"); } void tst_QUrl::taskQTBUG_6962() -- cgit v1.2.3