From 61929c30fceebdc1813176a3807efb9ca102a01f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 10 Mar 2015 09:34:09 -0700 Subject: [PATCH] tst_QUrl: Add extra testcases Task-number: QTBUG-44921 Task-number: QTBUG-44920 Change-Id: Iee8cbc07c4434ce9b560ffff13ca303803916c2d Reviewed-by: Richard J. Moore --- tests/auto/corelib/io/qurl/tst_qurl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 2015629a59..7579c6713d 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2015 Intel Corporation. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -1248,6 +1248,10 @@ void tst_QUrl::fromLocalFile_data() << QString::fromLatin1("/a%25.txt"); QTest::newRow("data10") << QString::fromLatin1("/%80.txt") << QString::fromLatin1("file:///%2580.txt") << QString::fromLatin1("/%80.txt"); + QTest::newRow("data11") << QString::fromLatin1("./a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt"); + QTest::newRow("data12") << QString::fromLatin1("././a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt"); + QTest::newRow("data13") << QString::fromLatin1("b/../a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt"); + QTest::newRow("data14") << QString::fromLatin1("/b/../a.txt") << QString::fromLatin1("file:///a.txt") << QString::fromLatin1("/a.txt"); } void tst_QUrl::fromLocalFile() @@ -2012,6 +2016,11 @@ void tst_QUrl::isValid() QVERIFY(url.toString().isEmpty()); QVERIFY(url.errorString().contains("':' before any '/'")); } + + { + QUrl url("file://./localfile.html"); + QVERIFY(!url.isValid()); + } } void tst_QUrl::schemeValidator_data()