From c68be56c295c8dda3043c80d4641575ec2799e55 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 17 Oct 2019 20:33:50 +0200 Subject: size some stringbuffer to prevent re-alloc Change-Id: I385587a922c555c320a45dcc6d644315b72510e9 Reviewed-on: https://gerrit.libreoffice.org/81278 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/qa/cppunit/test_breakiterator.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'i18npool/qa/cppunit/test_breakiterator.cxx') diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 7daf9e98e573..a1d423879109 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -792,10 +792,10 @@ void TestBreakIterator::testWeak() for (sal_Int32 i = 0; i < aWeaks.getLength(); ++i) { sal_Int16 nScript = m_xBreak->getScriptType(aWeaks, i); - OStringBuffer aMsg; - aMsg.append("Char 0x"); - aMsg.append(static_cast(aWeaks[i]), 16); - aMsg.append(" should have been weak"); + OString aMsg = + "Char 0x" + + OString::number(static_cast(aWeaks[i]), 16) + + " should have been weak"; CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), i18n::ScriptType::WEAK, nScript); } @@ -831,10 +831,10 @@ void TestBreakIterator::testAsian() for (sal_Int32 i = 0; i < aAsians.getLength(); ++i) { sal_Int16 nScript = m_xBreak->getScriptType(aAsians, i); - OStringBuffer aMsg; - aMsg.append("Char 0x"); - aMsg.append(static_cast(aAsians[i]), 16); - aMsg.append(" should have been asian"); + OString aMsg = + "Char 0x" + + OString::number(static_cast(aAsians[i]), 16) + + " should have been asian"; CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), i18n::ScriptType::ASIAN, nScript); } -- cgit