summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-16 15:06:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-17 07:28:49 +0200
commit8b4719c29fc9bd7e198ad6ced301e1ff7a350f16 (patch)
treed3ec594b343f56c76056418d835d3bc7b696a9ab /sal
parentf51cd77bcecc5134e0e04c398bfb7b34eb65d68d (diff)
Rename OUStringLiteral1 to OUStringChar
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/strings/test_oustring_stringliterals.cxx28
-rw-r--r--sal/qa/rtl/uri/rtl_testuri.cxx14
2 files changed, 21 insertions, 21 deletions
diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
index a98401351a7f..33902e28ad3b 100644
--- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx
@@ -36,7 +36,7 @@ private:
void checkNonconstChar();
void checkBuffer();
void checkOUStringLiteral();
- void checkOUStringLiteral1();
+ void checkOUStringChar();
void checkUtf16();
void testcall( const char str[] );
@@ -51,7 +51,7 @@ CPPUNIT_TEST(checkExtraIntArgument);
CPPUNIT_TEST(checkNonconstChar);
CPPUNIT_TEST(checkBuffer);
CPPUNIT_TEST(checkOUStringLiteral);
-CPPUNIT_TEST(checkOUStringLiteral1);
+CPPUNIT_TEST(checkOUStringChar);
CPPUNIT_TEST(checkUtf16);
CPPUNIT_TEST_SUITE_END();
};
@@ -317,39 +317,39 @@ void test::oustring::StringLiterals::checkOUStringLiteral()
sal_Int32(5), b.lastIndexOf(rtlunittest::OUStringLiteral("ab")));
}
-void test::oustring::StringLiterals::checkOUStringLiteral1()
+void test::oustring::StringLiterals::checkOUStringChar()
{
- auto l1 = rtlunittest::OUStringLiteral1('A');
+ auto l1 = rtlunittest::OUStringChar('A');
CPPUNIT_ASSERT_EQUAL(u'A', l1.c);
char const c2 = 'A';
- auto l2 = rtlunittest::OUStringLiteral1(c2);
+ auto l2 = rtlunittest::OUStringChar(c2);
CPPUNIT_ASSERT_EQUAL(u'A', l2.c);
- char c3 = 'A'; auto l3 = rtlunittest::OUStringLiteral1(c3);
+ char c3 = 'A'; auto l3 = rtlunittest::OUStringChar(c3);
CPPUNIT_ASSERT_EQUAL(u'A', l3.c);
- auto l4 = rtlunittest::OUStringLiteral1(u'A');
+ auto l4 = rtlunittest::OUStringChar(u'A');
CPPUNIT_ASSERT_EQUAL(u'A', l4.c);
sal_Unicode const c5 = 0x100;
- auto l5 = rtlunittest::OUStringLiteral1(c5);
+ auto l5 = rtlunittest::OUStringChar(c5);
CPPUNIT_ASSERT_EQUAL(c5, l5.c);
- rtl::OUString s1{rtlunittest::OUStringLiteral1('A')};
+ rtl::OUString s1{rtlunittest::OUStringChar('A')};
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getLength());
CPPUNIT_ASSERT_EQUAL(u'A', s1[0]);
CPPUNIT_ASSERT_EQUAL(
- true, rtl::OUString("A") == rtlunittest::OUStringLiteral1('A'));
+ true, rtl::OUString("A") == rtlunittest::OUStringChar('A'));
CPPUNIT_ASSERT_EQUAL(
- false, rtl::OUString("AB") == rtlunittest::OUStringLiteral1('A'));
+ false, rtl::OUString("AB") == rtlunittest::OUStringChar('A'));
CPPUNIT_ASSERT_EQUAL(
- false, rtl::OUString("A") != rtlunittest::OUStringLiteral1('A'));
+ false, rtl::OUString("A") != rtlunittest::OUStringChar('A'));
CPPUNIT_ASSERT_EQUAL(
- true, rtl::OUString("AB") != rtlunittest::OUStringLiteral1('A'));
+ true, rtl::OUString("AB") != rtlunittest::OUStringChar('A'));
- rtl::OUString s2("A" + rtlunittest::OUStringLiteral1('b'));
+ rtl::OUString s2("A" + rtlunittest::OUStringChar('b'));
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), s2.getLength());
CPPUNIT_ASSERT_EQUAL(u'A', s2[0]);
CPPUNIT_ASSERT_EQUAL(u'b', s2[1]);
diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx
index aea0d50c6c54..b69013e1ed36 100644
--- a/sal/qa/rtl/uri/rtl_testuri.cxx
+++ b/sal/qa/rtl/uri/rtl_testuri.cxx
@@ -181,10 +181,10 @@ void Test::test_Uri() {
// Check surrogate handling:
- aText1 = OUStringLiteral1(u'\xD800') + // %ED%A0%80
- OUStringLiteral1(u'\xD800') + // %F0%90%8F%BF
- OUStringLiteral1(u'\xDFFF') +
- OUStringLiteral1(u'\xDFFF') + // %ED%BF%BF
+ aText1 = OUStringChar(u'\xD800') + // %ED%A0%80
+ OUStringChar(u'\xD800') + // %F0%90%8F%BF
+ OUStringChar(u'\xDFFF') +
+ OUStringChar(u'\xDFFF') + // %ED%BF%BF
"A"; // A
aText2 = "%ED%A0%80" "%F0%90%8F%BF" "%ED%BF%BF" "A";
CPPUNIT_ASSERT_EQUAL_MESSAGE(
@@ -208,8 +208,8 @@ void Test::test_Uri() {
aText1 = "%ed%a0%80" "%f0%90%8f%bf" "%ed%bf%bf" "A";
aText2 = "%ED%A0%80" +
- OUStringLiteral1(u'\xD800') +
- OUStringLiteral1(u'\xDFFF') +
+ OUStringChar(u'\xD800') +
+ OUStringChar(u'\xDFFF') +
"%ED%BF%BF"
"A";
CPPUNIT_ASSERT_EQUAL_MESSAGE(
@@ -248,7 +248,7 @@ void Test::test_Uri() {
aText1 = "%30%C3%BF";
aText2 = "%30" +
- OUStringLiteral1(u'\x00FF');
+ OUStringChar(u'\x00FF');
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"failure 18",
aText2,