[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/frameworks] staging/kde4support/autotests: Fix for QUrl behavior change:
From:       David Faure <faure () kde ! org>
Date:       2013-09-23 6:41:29
Message-ID: E1VNzpp-0006JG-7A () scm ! kde ! org
[Download RAW message or body]

Git commit f01080743597ebcd8f097456ff423fa12b4424bb by David Faure.
Committed on 23/09/2013 at 06:45.
Pushed by dfaure into branch 'frameworks'.

Fix for QUrl behavior change:

aba336c2b4ad8926dc8a000718bbb7f8a6d5a72d in qtbase: "QUrl now
normalizes the path given in setPath, removing ./ and ../ and duplicate
slashes."

M  +6    -4    staging/kde4support/autotests/kurltest.cpp

http://commits.kde.org/kdelibs/f01080743597ebcd8f097456ff423fa12b4424bb

diff --git a/staging/kde4support/autotests/kurltest.cpp b/staging/kde4support/autotests/kurltest.cpp
index 410c495..2f43b79 100644
--- a/staging/kde4support/autotests/kurltest.cpp
+++ b/staging/kde4support/autotests/kurltest.cpp
@@ -757,9 +757,11 @@ void KUrlTest::testDirectory()
   u2.cleanPath();
   QCOMPARE( u2.url(), QString("file:///home/dfaure/") );
   u2.addPath( "/..//foo" );
+  QCOMPARE( u2.url(), QString("file:///home/foo") ); // Qt >= 5.2: cleaned up already
+  u2 = KUrl(QByteArray("file:///home/dfaure/..//foo"));
   QCOMPARE( u2.url(), QString("file:///home/dfaure/..//foo") );
   u2.cleanPath(KUrl::KeepDirSeparators);
-  QCOMPARE( u2.url(), QString("file:///home//foo") );
+  QCOMPARE( u2.url(), QString("file:///home/foo") );
   u2.cleanPath(KUrl::SimplifyDirSeparators);
   QCOMPARE( u2.url(), QString("file:///home/foo") );
 
@@ -1067,7 +1069,7 @@ void KUrlTest::testBaseURL() // those are tests for the KUrl(base,relative) cons
 
   baseURL = "http://www.foo.bar";
   KUrl rel_url( baseURL, "/top//test/../test1/file.html" );
-  QCOMPARE( rel_url.url(), QString("http://www.foo.bar/top//test1/file.html" ));
+  QCOMPARE( rel_url.url(), QString("http://www.foo.bar/top/test1/file.html" ));
 
 
   baseURL = "http://www.foo.bar/top//test2/file2.html";
@@ -1082,7 +1084,7 @@ void KUrlTest::testBaseURL() // those are tests for the KUrl(base,relative) cons
 
   baseURL = "file:/usr/local/src/kde2/kdelibs/kio/";
   KUrl url2( baseURL, "../../////kdebase/konqueror" );
-  QCOMPARE( url2.url(), QString("file:///usr/local/src/kde2/////kdebase/konqueror" ));
+  QCOMPARE( url2.url(), QString("file:///usr/local/src/kde2/kdebase/konqueror" ));
 
 
   // WABA: The following tests are to test the handling of relative URLs as
@@ -1778,7 +1780,7 @@ void KUrlTest::testSmb()
 
   KUrl noImplicitSmb("//path1/path2");
   QVERIFY(noImplicitSmb.isLocalFile());
-  QCOMPARE(noImplicitSmb.path(), QString("//path1/path2"));
+  QCOMPARE(noImplicitSmb.path(), QString("/path1/path2"));
 }
 
 void KUrlTest::testOtherProtocols()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic