ed91eda
From 2a68dc02bd19a717d3c86873206fabed1098f228 Mon Sep 17 00:00:00 2001
ed91eda
From: Stephan Bergmann <sbergman@redhat.com>
ed91eda
Date: Mon, 31 Jul 2023 17:09:32 +0200
ed91eda
Subject: [PATCH] Adapt test code to cURL 8.2.0
ed91eda
ed91eda
...for which CppunitTest_ucb_webdav_core would fail with
ed91eda
ed91eda
> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:60:(anonymous namespace)::webdav_local_test::WebdavUriTest
ed91eda
> equality assertion failed
ed91eda
> - Expected: ?query#fragment
ed91eda
> - Actual  : /?query#fragment
ed91eda
ed91eda
and
ed91eda
ed91eda
> ucb/qa/cppunit/webdav/webdav_local_neon.cxx:89:(anonymous namespace)::webdav_local_test::WebdavUriTest2
ed91eda
> equality assertion failed
ed91eda
> - Expected: ?query
ed91eda
> - Actual  : /?query
ed91eda
ed91eda
because of
ed91eda
<https://github.com/bch/curl/commit/5752e71080cb3aafa8b24c3261419345b832bc92>
ed91eda
"urlapi: have *set(PATH) prepend a slash if one is missing".
ed91eda
ed91eda
All that test code had been added with b03e070420606d407df2ec5e9dfa7043ecc46177
ed91eda
"ucb: webdav-curl: fix CurlUri::CloneWithRelativeRefPathAbsolute()", and it
ed91eda
looks harmless for our use cases that cURL started to behave differently there
ed91eda
now.  So instead of accepting either of the outcomes depending on what cURL
ed91eda
version is being used, just change the test code to not leave out the
ed91eda
path-absolute in the calls to CloneWithRelativeRefPathAbsolute (which is
ed91eda
documented in ucb/source/ucp/webdav-curl/CurlUri.hxx to take
ed91eda
ed91eda
>     /// @param matches: relative-ref = path-absolute [ "?" query ] [ "#" fragment ]
ed91eda
ed91eda
and path-absolute cannot be empty as per RFC 3986 "Uniform Resource Identifier
ed91eda
(URI): Generic Syntax").
ed91eda
ed91eda
Change-Id: If07a28598dfa047ebe89d8bcda19e8fcaa36aed0
ed91eda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155099
ed91eda
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
ed91eda
Tested-by: Jenkins
ed91eda
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
ed91eda
---
ed91eda
 ucb/qa/cppunit/webdav/webdav_local_neon.cxx | 8 ++++----
ed91eda
 1 file changed, 4 insertions(+), 4 deletions(-)
ed91eda
ed91eda
diff --git a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
ed91eda
index bde7652b9ffa..a457bc6d2b28 100644
ed91eda
--- a/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
ed91eda
+++ b/ucb/qa/cppunit/webdav/webdav_local_neon.cxx
ed91eda
@@ -52,12 +52,12 @@ namespace
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), uri2.GetRelativeReference() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("http://user%40anothername@server.biz:8040/foo/bar"), uri2.GetURI() );
ed91eda
 
ed91eda
-        CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query#fragment"));
ed91eda
+        CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query#fragment"));
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("http"), uri3.GetScheme() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("user%40anothername"), uri3.GetUser() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() );
ed91eda
-        CPPUNIT_ASSERT_EQUAL( OUString("?query#fragment"), uri3.GetRelativeReference() );
ed91eda
+        CPPUNIT_ASSERT_EQUAL( OUString("/?query#fragment"), uri3.GetRelativeReference() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("http://user%40anothername@server.biz:8040/?query#fragment"), uri3.GetURI() );
ed91eda
     }
ed91eda
 
ed91eda
@@ -80,13 +80,13 @@ namespace
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("/foo/bar"), uri2.GetRelativeReference() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("https://foo:bar@server.biz:8040/foo/bar"), uri2.GetURI() );
ed91eda
 
ed91eda
-        CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"?query"));
ed91eda
+        CurlUri uri3(aURI.CloneWithRelativeRefPathAbsolute(u"/?query"));
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("https"), uri3.GetScheme() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("server.biz"), uri3.GetHost() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("foo"), uri3.GetUser() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("bar"), uri3.GetPassword() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( sal_uInt16(8040), uri3.GetPort() );
ed91eda
-        CPPUNIT_ASSERT_EQUAL( OUString("?query"), uri3.GetRelativeReference() );
ed91eda
+        CPPUNIT_ASSERT_EQUAL( OUString("/?query"), uri3.GetRelativeReference() );
ed91eda
         CPPUNIT_ASSERT_EQUAL( OUString("https://foo:bar@server.biz:8040/?query"), uri3.GetURI() );
ed91eda
     }
ed91eda
 
ed91eda
-- 
ed91eda
2.41.0
ed91eda