diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-28 17:55:37 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-28 18:26:57 +0200 |
commit | c741633310db3e32e9e07c8e045d11b29f2db606 (patch) | |
tree | 72fea353149ad643a14f9d156eb60b68362302a8 /sal/qa | |
parent | loplugin:salunicodeliteral: sax (diff) | |
download | core-c741633310db3e32e9e07c8e045d11b29f2db606.tar.gz core-c741633310db3e32e9e07c8e045d11b29f2db606.zip |
loplugin:salunicodeliteral: sal
Change-Id: I1b7c3f8de5b09c96e27aa9124096b00638afb3f3
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/rtl/oustring/rtl_OUString2.cxx | 14 | ||||
-rw-r--r-- | sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_stringliterals.cxx | 16 | ||||
-rw-r--r-- | sal/qa/rtl/textenc/rtl_textcvt.cxx | 4 | ||||
-rw-r--r-- | sal/qa/rtl/uri/rtl_testuri.cxx | 14 |
5 files changed, 25 insertions, 25 deletions
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx index 6c71751d3992..15748fcf8d2f 100644 --- a/sal/qa/rtl/oustring/rtl_OUString2.cxx +++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx @@ -989,13 +989,13 @@ void createFromCodePoints::test() { static sal_uInt32 const cp[] = { 0, 0xD800, 0xFFFF, 0x10000, 0x10FFFF }; rtl::OUString s(cp, sizeof cp / sizeof (sal_uInt32)); CPPUNIT_ASSERT_EQUAL(sal_Int32(7), s.getLength()); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0), s[0]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xD800), s[1]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xFFFF), s[2]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xD800), s[3]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xDC00), s[4]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xDBFF), s[5]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xDFFF), s[6]); + CPPUNIT_ASSERT_EQUAL(u'\0', s[0]); + CPPUNIT_ASSERT_EQUAL(u'\xD800', s[1]); + CPPUNIT_ASSERT_EQUAL(u'\xFFFF', s[2]); + CPPUNIT_ASSERT_EQUAL(u'\xD800', s[3]); + CPPUNIT_ASSERT_EQUAL(u'\xDC00', s[4]); + CPPUNIT_ASSERT_EQUAL(u'\xDBFF', s[5]); + CPPUNIT_ASSERT_EQUAL(u'\xDFFF', s[6]); } class iterateCodePoints: public CppUnit::TestFixture { diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx index 707034b3affa..6fca739125b0 100644 --- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx +++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_appendchar.cxx @@ -30,7 +30,7 @@ void AppendChar::testAppendChar() { rtl::OUStringBuffer s; s.append('a'); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s.getLength()); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('a'), s[0]); + CPPUNIT_ASSERT_EQUAL(u'a', s[0]); } } } diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index 5b1b8ea83e04..37bc50ecc619 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -317,17 +317,17 @@ void test::oustring::StringLiterals::checkOUStringLiteral() void test::oustring::StringLiterals::checkOUStringLiteral1() { auto l1 = rtlunittest::OUStringLiteral1('A'); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l1.c); + CPPUNIT_ASSERT_EQUAL(u'A', l1.c); char const c2 = 'A'; auto l2 = rtlunittest::OUStringLiteral1(c2); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l2.c); + CPPUNIT_ASSERT_EQUAL(u'A', l2.c); char c3 = 'A'; auto l3 = rtlunittest::OUStringLiteral1(c3); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l3.c); + CPPUNIT_ASSERT_EQUAL(u'A', l3.c); - auto l4 = rtlunittest::OUStringLiteral1(sal_Unicode('A')); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), l4.c); + auto l4 = rtlunittest::OUStringLiteral1(u'A'); + CPPUNIT_ASSERT_EQUAL(u'A', l4.c); sal_Unicode const c5 = 0x100; auto l5 = rtlunittest::OUStringLiteral1(c5); @@ -335,7 +335,7 @@ void test::oustring::StringLiterals::checkOUStringLiteral1() rtl::OUString s1{rtlunittest::OUStringLiteral1('A')}; CPPUNIT_ASSERT_EQUAL(sal_Int32(1), s1.getLength()); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s1[0]); + CPPUNIT_ASSERT_EQUAL(u'A', s1[0]); CPPUNIT_ASSERT_EQUAL( true, rtl::OUString("A") == rtlunittest::OUStringLiteral1('A')); @@ -348,8 +348,8 @@ void test::oustring::StringLiterals::checkOUStringLiteral1() rtl::OUString s2("A" + rtlunittest::OUStringLiteral1('b')); CPPUNIT_ASSERT_EQUAL(sal_Int32(2), s2.getLength()); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('A'), s2[0]); - CPPUNIT_ASSERT_EQUAL(sal_Unicode('b'), s2[1]); + CPPUNIT_ASSERT_EQUAL(u'A', s2[0]); + CPPUNIT_ASSERT_EQUAL(u'b', s2[1]); } void test::oustring::StringLiterals::checkUtf16() { diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx index bb85141b8052..c9d7e5f08117 100644 --- a/sal/qa/rtl/textenc/rtl_textcvt.cxx +++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx @@ -83,7 +83,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("rSet.m_aMap[" + OUString::number(i) + "] == " + OUString::number(rSet.m_aMap[i], 16)), RTL_TEXTENCODING_UTF8).getStr(), - static_cast<sal_Unicode>(0xFFFF), rSet.m_aMap[i]); + u'\xFFFF', rSet.m_aMap[i]); CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("aUnicode[" + OUString::number(j) + "] == " + OUString::number(aUnicode[j], 16) + ", rSet.m_aMap[" + OUString::number(i) + "] == " + @@ -130,7 +130,7 @@ void testSingleByteCharSet(SingleByteCharSet const & rSet) { CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("rSet.m_aMap[" + OUString::number(i) + "] == " + OUString::number(rSet.m_aMap[i], 16)), RTL_TEXTENCODING_UTF8).getStr(), - static_cast<sal_Unicode>(0xFFFF), rSet.m_aMap[i]); + u'\xFFFF', rSet.m_aMap[i]); CPPUNIT_ASSERT_EQUAL_MESSAGE(OUStringToOString(OUString("aText[" + OUString::number(j) + "] == " + OUString::number(i, 16)), RTL_TEXTENCODING_UTF8).getStr(), diff --git a/sal/qa/rtl/uri/rtl_testuri.cxx b/sal/qa/rtl/uri/rtl_testuri.cxx index 05c3349d5bb8..e60797731d2f 100644 --- a/sal/qa/rtl/uri/rtl_testuri.cxx +++ b/sal/qa/rtl/uri/rtl_testuri.cxx @@ -182,10 +182,10 @@ void Test::test_Uri() { // Check surrogate handling: - aBuffer.append(static_cast< sal_Unicode >(0xD800)); // %ED%A0%80 - aBuffer.append(static_cast< sal_Unicode >(0xD800)); // %F0%90%8F%BF - aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); - aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); // %ED%BF%BF + aBuffer.append(u'\xD800'); // %ED%A0%80 + aBuffer.append(u'\xD800'); // %F0%90%8F%BF + aBuffer.append(u'\xDFFF'); + aBuffer.append(u'\xDFFF'); // %ED%BF%BF aBuffer.append('A'); // A aText1 = aBuffer.makeStringAndClear(); aText2 = "%ED%A0%80" "%F0%90%8F%BF" "%ED%BF%BF" "A"; @@ -210,8 +210,8 @@ void Test::test_Uri() { aText1 = "%ed%a0%80" "%f0%90%8f%bf" "%ed%bf%bf" "A"; aBuffer.append("%ED%A0%80"); - aBuffer.append(static_cast< sal_Unicode >(0xD800)); - aBuffer.append(static_cast< sal_Unicode >(0xDFFF)); + aBuffer.append(u'\xD800'); + aBuffer.append(u'\xDFFF'); aBuffer.append("%ED%BF%BF"); aBuffer.append('A'); aText2 = aBuffer.makeStringAndClear(); @@ -251,7 +251,7 @@ void Test::test_Uri() { aText1 = "%30%C3%BF"; aBuffer.append("%30"); - aBuffer.append(static_cast< sal_Unicode >(0x00FF)); + aBuffer.append(u'\x00FF'); aText2 = aBuffer.makeStringAndClear(); CPPUNIT_ASSERT_EQUAL_MESSAGE( "failure 18", |