diff options
Diffstat (limited to 'sal')
-rw-r--r-- | sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx index 2a4f35e2e793..764b03d8c220 100644 --- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx +++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx @@ -81,45 +81,41 @@ void createMessage( void test::oustringbuffer::Utf32::appendUtf32() { int const str1Len = 3; sal_Unicode const str1[str1Len] = { 'a', 'b', 'c' }; - int const str2Len = 4; - sal_Unicode const str2[str2Len] = { 'a', 'b', 'c', 'd' }; - int const str3Len = 6; - sal_Unicode const str3[str3Len] = { 'a', 'b', 'c', 'd', 0xD800, 0xDC00 }; + static constexpr OUStringLiteral str2 = u"abcd"; + static constexpr OUStringLiteral str3 = u"abcd\U00010000"; OStringBuffer message; OUStringBuffer buf1(std::u16string_view(str1, str1Len)); buf1.appendUtf32('d'); OUString res1(buf1.makeStringAndClear()); - createMessage(message, res1, OUString(str2, str2Len)); + createMessage(message, res1, str2); CPPUNIT_ASSERT_EQUAL_MESSAGE( - message.getStr(), OUString(str2, str2Len), res1); - OUStringBuffer buf2(std::u16string_view(str2, str2Len)); + message.getStr(), OUString(str2), res1); + OUStringBuffer buf2(str2); buf2.appendUtf32(0x10000); OUString res2(buf2.makeStringAndClear()); - createMessage(message, res2, OUString(str3, str3Len)); + createMessage(message, res2, str3); CPPUNIT_ASSERT_EQUAL_MESSAGE( - message.getStr(), OUString(str3, str3Len), res2); + message.getStr(), OUString(str3), res2); } void test::oustringbuffer::Utf32::insertUtf32() { int const str1Len = 3; sal_Unicode const str1[str1Len] = { 'a', 'b', 'c' }; - int const str2Len = 4; - sal_Unicode const str2[str2Len] = { 'a', 'b', 'd', 'c' }; - int const str3Len = 6; - sal_Unicode const str3[str3Len] = { 'a', 'b', 0xDBFF, 0xDFFF, 'd', 'c' }; + static constexpr OUStringLiteral str2 = u"abdc"; + static constexpr OUStringLiteral str3 = u"ab\U0010FFFFdc"; OStringBuffer message; OUStringBuffer buf1(std::u16string_view(str1, str1Len)); buf1.insertUtf32(2, 'd'); OUString res1(buf1.makeStringAndClear()); - createMessage(message, res1, OUString(str2, str2Len)); + createMessage(message, res1, str2); CPPUNIT_ASSERT_EQUAL_MESSAGE( - message.getStr(), OUString(str2, str2Len), res1); - OUStringBuffer buf2(std::u16string_view(str2, str2Len)); + message.getStr(), OUString(str2), res1); + OUStringBuffer buf2(str2); buf2.insertUtf32(2, 0x10FFFF); OUString res2(buf2.makeStringAndClear()); - createMessage(message, res2, OUString(str3, str3Len)); + createMessage(message, res2, str3); CPPUNIT_ASSERT_EQUAL_MESSAGE( - message.getStr(), OUString(str3, str3Len), res2); + message.getStr(), OUString(str3), res2); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |