diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-11-20 07:30:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-11-20 08:31:47 +0100 |
commit | 5ac4adaf026bab096febc2587f49edb603e98689 (patch) | |
tree | c95658db80212d0bd11a51576ac42b633f1f012b | |
parent | e66ccbecfb414800271e066c630cf7e90d5f3b74 (diff) |
Extended loplugin:ostr: comphelper
Change-Id: I338c3c263e940bbe6071827b2e19763b7dadc2e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159723
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | comphelper/qa/string/test_string.cxx | 34 | ||||
-rw-r--r-- | comphelper/qa/unit/base64_test.cxx | 6 | ||||
-rw-r--r-- | comphelper/qa/unit/propertyvalue.cxx | 2 |
3 files changed, 21 insertions, 21 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 7a97736c1e74..c6529949daee 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -88,14 +88,14 @@ void TestString::testIsdigitAsciiString() void TestString::testStripStart() { - OString aIn("abc"); + OString aIn("abc"_ostr); OString aOut; aOut = ::comphelper::string::stripStart(aIn, 'b'); - CPPUNIT_ASSERT_EQUAL(OString("abc"), aOut); + CPPUNIT_ASSERT_EQUAL("abc"_ostr, aOut); aOut = ::comphelper::string::stripStart(aIn, 'a'); - CPPUNIT_ASSERT_EQUAL(OString("bc"), aOut); + CPPUNIT_ASSERT_EQUAL("bc"_ostr, aOut); aIn = "aaa"; aOut = ::comphelper::string::stripStart(aIn, 'a'); @@ -103,19 +103,19 @@ void TestString::testStripStart() aIn = "aba"; aOut = ::comphelper::string::stripStart(aIn, 'a'); - CPPUNIT_ASSERT_EQUAL(OString("ba"), aOut); + CPPUNIT_ASSERT_EQUAL("ba"_ostr, aOut); } void TestString::testStripEnd() { - OString aIn("abc"); + OString aIn("abc"_ostr); OString aOut; aOut = ::comphelper::string::stripEnd(aIn, 'b'); - CPPUNIT_ASSERT_EQUAL(OString("abc"), aOut); + CPPUNIT_ASSERT_EQUAL("abc"_ostr, aOut); aOut = ::comphelper::string::stripEnd(aIn, 'c'); - CPPUNIT_ASSERT_EQUAL(OString("ab"), aOut); + CPPUNIT_ASSERT_EQUAL("ab"_ostr, aOut); aIn = "aaa"; aOut = ::comphelper::string::stripEnd(aIn, 'a'); @@ -123,19 +123,19 @@ void TestString::testStripEnd() aIn = "aba"; aOut = ::comphelper::string::stripEnd(aIn, 'a'); - CPPUNIT_ASSERT_EQUAL(OString("ab"), aOut); + CPPUNIT_ASSERT_EQUAL("ab"_ostr, aOut); } void TestString::testStrip() { - OString aIn("abc"); + OString aIn("abc"_ostr); OString aOut; aOut = ::comphelper::string::strip(aIn, 'b'); - CPPUNIT_ASSERT_EQUAL(OString("abc"), aOut); + CPPUNIT_ASSERT_EQUAL("abc"_ostr, aOut); aOut = ::comphelper::string::strip(aIn, 'c'); - CPPUNIT_ASSERT_EQUAL(OString("ab"), aOut); + CPPUNIT_ASSERT_EQUAL("ab"_ostr, aOut); aIn = "aaa"; aOut = ::comphelper::string::strip(aIn, 'a'); @@ -143,25 +143,25 @@ void TestString::testStrip() aIn = "aba"; aOut = ::comphelper::string::strip(aIn, 'a'); - CPPUNIT_ASSERT_EQUAL(OString("b"), aOut); + CPPUNIT_ASSERT_EQUAL("b"_ostr, aOut); } void TestString::testToken() { - OString aIn("10.11.12"); + OString aIn("10.11.12"_ostr); OString aOut; aOut = aIn.getToken(-1, '.'); CPPUNIT_ASSERT(aOut.isEmpty()); aOut = aIn.getToken(0, '.'); - CPPUNIT_ASSERT_EQUAL(OString("10"), aOut); + CPPUNIT_ASSERT_EQUAL("10"_ostr, aOut); aOut = aIn.getToken(1, '.'); - CPPUNIT_ASSERT_EQUAL(OString("11"), aOut); + CPPUNIT_ASSERT_EQUAL("11"_ostr, aOut); aOut = aIn.getToken(2, '.'); - CPPUNIT_ASSERT_EQUAL(OString("12"), aOut); + CPPUNIT_ASSERT_EQUAL("12"_ostr, aOut); aOut = aIn.getToken(3, '.'); CPPUNIT_ASSERT(aOut.isEmpty()); @@ -169,7 +169,7 @@ void TestString::testToken() void TestString::testTokenCount() { - OString aIn("10.11.12"); + OString aIn("10.11.12"_ostr); sal_Int32 nOut; nOut = ::comphelper::string::getTokenCount(aIn, '.'); diff --git a/comphelper/qa/unit/base64_test.cxx b/comphelper/qa/unit/base64_test.cxx index a1cd5d0006be..dc637f63f709 100644 --- a/comphelper/qa/unit/base64_test.cxx +++ b/comphelper/qa/unit/base64_test.cxx @@ -93,17 +93,17 @@ void Base64Test::testBase64EncodeForOStringBuffer() inputSequence = { 0, 0, 0, 0, 0, 1, 2, 3 }; comphelper::Base64::encode(aBuffer, inputSequence); - CPPUNIT_ASSERT_EQUAL(OString("AAAAAAABAgM="), aBuffer.toString()); + CPPUNIT_ASSERT_EQUAL("AAAAAAABAgM="_ostr, aBuffer.toString()); aBuffer.setLength(0); inputSequence = { 5, 2, 3, 0, 0, 1, 2, 3 }; comphelper::Base64::encode(aBuffer, inputSequence); - CPPUNIT_ASSERT_EQUAL(OString("BQIDAAABAgM="), aBuffer.toString()); + CPPUNIT_ASSERT_EQUAL("BQIDAAABAgM="_ostr, aBuffer.toString()); aBuffer.setLength(0); inputSequence = { sal_Int8(sal_uInt8(200)), 31, 77, 111, 0, 1, 2, 3 }; comphelper::Base64::encode(aBuffer, inputSequence); - CPPUNIT_ASSERT_EQUAL(OString("yB9NbwABAgM="), aBuffer.makeStringAndClear()); + CPPUNIT_ASSERT_EQUAL("yB9NbwABAgM="_ostr, aBuffer.makeStringAndClear()); } CPPUNIT_TEST_SUITE_REGISTRATION(Base64Test); diff --git a/comphelper/qa/unit/propertyvalue.cxx b/comphelper/qa/unit/propertyvalue.cxx index 738022917e9d..4470b28f503a 100644 --- a/comphelper/qa/unit/propertyvalue.cxx +++ b/comphelper/qa/unit/propertyvalue.cxx @@ -103,7 +103,7 @@ class MakePropertyValueTest : public CppUnit::TestFixture ] } } -)json"); +)json"_ostr); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), aRet.size()); beans::PropertyValue aFirst = aRet[0]; CPPUNIT_ASSERT_EQUAL(OUString("FieldType"), aFirst.Name); |