summaryrefslogtreecommitdiff
path: root/tools/qa/cppunit
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-11-01 00:37:19 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-11-01 10:24:21 +0100
commit9f1289f1e3c9b4a5f2be7a7187877db6b5015973 (patch)
tree4e042a908529f291db9321d1849de83b82d548bc /tools/qa/cppunit
parentd8326f1f54b2f4644b52fbfa7106eeeae6e5bb7b (diff)
tdf#157820: handle \\?\ prefixes in INetURLObject
They are already handled in osl file URL functions. Change-Id: Id0c224bdb79963e7ce52abde57bf05b0a6a81ff5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158741 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'tools/qa/cppunit')
-rw-r--r--tools/qa/cppunit/test_urlobj.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx
index 2c8ae1a36a25..fff77e41f5e7 100644
--- a/tools/qa/cppunit/test_urlobj.cxx
+++ b/tools/qa/cppunit/test_urlobj.cxx
@@ -332,6 +332,26 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString(""), obj.GetHost());
CPPUNIT_ASSERT_EQUAL(OUString("80a0/foo"), obj.GetURLPath());
}
+ {
+ // Test Windows \\?\C:... long path scheme
+ INetURLObject base(u"file:///C:/foo"); // set up base path
+ bool bWasAbsolute = false;
+ INetURLObject obj
+ = base.smartRel2Abs(u"\\\\?\\D:\\bar\\baz.ext"_ustr, bWasAbsolute);
+ CPPUNIT_ASSERT(bWasAbsolute);
+ CPPUNIT_ASSERT_EQUAL(u"file:///D:/bar/baz.ext"_ustr,
+ obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ }
+ {
+ // Test Windows \\?\UNC\Server... long path scheme
+ INetURLObject base(u"file://ServerFoo/fooShare"); // set up base path
+ bool bWasAbsolute = false;
+ INetURLObject obj = base.smartRel2Abs(
+ u"\\\\?\\UNC\\ServerBar\\barShare\\baz.ext"_ustr, bWasAbsolute);
+ CPPUNIT_ASSERT(bWasAbsolute);
+ CPPUNIT_ASSERT_EQUAL(u"file://ServerBar/barShare/baz.ext"_ustr,
+ obj.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ }
}
// Change the following lines only, if you add, remove or rename