summaryrefslogtreecommitdiff
path: root/svl/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-02-07 15:34:33 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-02-10 13:51:59 +0100
commit289d2e5c86ffa99bc6a8c6c51f630d629afcd954 (patch)
tree338ddc1787e080a3b0da7833ee44c5b6c68c6e3a /svl/qa
parent942c0d71a91839fc1762c7e93417e7bb703ea3cf (diff)
tdf#130501: Fix off-by-one error in URIHelper::resolveIdnaHost
Change-Id: Ibc231308d0fc93085933ae7d80dc8c4b2699fe02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88204 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 4c0394461af4d6bcba059161113abffbb484efe8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88295 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'svl/qa')
-rw-r--r--svl/qa/unit/test_URIHelper.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx
index 11b7d0359b2a..5954bcd39289 100644
--- a/svl/qa/unit/test_URIHelper.cxx
+++ b/svl/qa/unit/test_URIHelper.cxx
@@ -463,6 +463,19 @@ void Test::testResolveIdnaHost() {
CPPUNIT_ASSERT_EQUAL(
OUString("foo://xn--mnchen-3ya.de"),
URIHelper::resolveIdnaHost(u"foo://Mu\u0308nchen.de"));
+
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("foo://example.xn--m-eha"), URIHelper::resolveIdnaHost(u"foo://example.mü"));
+
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("foo://example.xn--m-eha:0"), URIHelper::resolveIdnaHost(u"foo://example.mü:0"));
+
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("foo://xn--e1afmkfd.xn--p1ai"), URIHelper::resolveIdnaHost(u"foo://пример.рф"));
+
+ CPPUNIT_ASSERT_EQUAL(
+ OUString("foo://xn--e1afmkfd.xn--p1ai:0"),
+ URIHelper::resolveIdnaHost(u"foo://пример.рф:0"));
}
css::uno::Reference< css::uno::XComponentContext > Test::m_context;