diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 10:55:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-13 08:16:03 +0200 |
commit | 3457da6abe0fd03efd19442e9790fbd1aa04c160 (patch) | |
tree | a7a2d5b51839b200e7cda79af863dce7a04d3a10 /sal | |
parent | 47196637a41ddfc9a8707771b1b9f482fd72c3b6 (diff) |
loplugin:stringstatic also look for local statics
Add some API to O*StringLiteral, to make it easier
to use in some places that were using O*String
Change-Id: I1fb93bd47ac2065c9220d509aad3f4320326d99e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100270
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/qa/osl/pipe/osl_Pipe.cxx | 9 | ||||
-rw-r--r-- | sal/qa/rtl/digest/rtl_digest.cxx | 20 |
2 files changed, 14 insertions, 15 deletions
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index 0237fa57a411..bf55bc1e975b 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -87,12 +87,11 @@ static void printPipeError( ::osl::Pipe const & aPipe ) // pipe name and transfer contents -const OUString aTestPipeName("testpipe2"); -const OUString aTestPipe1("testpipe1"); -const OUString aTestString("Sun Microsystems"); +const OUStringLiteral aTestPipeName("testpipe2"); +const OUStringLiteral aTestPipe1("testpipe1"); -const OString m_pTestString1("Sun Microsystems"); -const OString m_pTestString2("test pipe PASS/OK"); +const OStringLiteral m_pTestString1("Sun Microsystems"); +const OStringLiteral m_pTestString2("test pipe PASS/OK"); // test code start here diff --git a/sal/qa/rtl/digest/rtl_digest.cxx b/sal/qa/rtl/digest/rtl_digest.cxx index 6bc9070be05c..e2392eaadcc8 100644 --- a/sal/qa/rtl/digest/rtl_digest.cxx +++ b/sal/qa/rtl/digest/rtl_digest.cxx @@ -38,8 +38,8 @@ using namespace rtl; namespace { -const OString sSampleString = "This is a sample sentence, which we use to check some crypto functions in sal."; -const OString sSampleString_only_one_diff = "This is a sample sentence. which we use to check some crypto functions in sal."; +const OStringLiteral sSampleString ("This is a sample sentence, which we use to check some crypto functions in sal."); +const OStringLiteral sSampleString_only_one_diff ("This is a sample sentence. which we use to check some crypto functions in sal."); const rtlDigestAlgorithm constDigestAlgorithms[] = { @@ -61,14 +61,14 @@ const sal_uInt32 constDigestAlgorithmLengths[] = RTL_DIGEST_LENGTH_HMAC_SHA1, }; -const OString constSampleStringSums[] = +const OStringLiteral constSampleStringSums[] = { - "647ee6c9d4aa5fdd374ed9d7a156acbf", - "b16b903e6fc0b62ae389013ed93fe531", - "eab2814429b2613301c8a077b806af3680548914", - "2bc5bdb7506a2cdc2fd27fc8b9889343012d5008", - "0b1b0e1a6f2e4420326354b031063605", - "1998c6a556915be76451bfb587fa7c34d849936e" + OStringLiteral("647ee6c9d4aa5fdd374ed9d7a156acbf"), + OStringLiteral("b16b903e6fc0b62ae389013ed93fe531"), + OStringLiteral("eab2814429b2613301c8a077b806af3680548914"), + OStringLiteral("2bc5bdb7506a2cdc2fd27fc8b9889343012d5008"), + OStringLiteral("0b1b0e1a6f2e4420326354b031063605"), + OStringLiteral("1998c6a556915be76451bfb587fa7c34d849936e") }; // Create hex-value string from the digest value to keep the string size minimal @@ -220,7 +220,7 @@ public: for (size_t i = 0; i < SAL_N_ELEMENTS(constDigestAlgorithms); i++) { OString aSum = getDigest(sSampleString, constDigestAlgorithms[i]); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Checksum of sample string is wrong.", constSampleStringSums[i], aSum); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Checksum of sample string is wrong.", OString(constSampleStringSums[i]), aSum); } } |