summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-10-13 08:44:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2023-10-15 21:15:49 +0200
commitb4844c310bd9897fef59e8a4da0513100ea86096 (patch)
tree379a43d012894ff06d29d79c7d4d8009b7853501 /basic
parent8797ba5e5d63151837ba443e1aea9d0997b6b7ab (diff)
Repurpose loplugin:stringstatic for O[U]String vars that can be constexpr
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/cppunit/test_scanner.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/basic/qa/cppunit/test_scanner.cxx b/basic/qa/cppunit/test_scanner.cxx
index 6559b3e35d48..f17750c89a6e 100644
--- a/basic/qa/cppunit/test_scanner.cxx
+++ b/basic/qa/cppunit/test_scanner.cxx
@@ -69,12 +69,12 @@ private:
CPPUNIT_TEST_SUITE_END();
};
-const OUString cr = "\n";
-const OUString rem = "REM";
-const OUString asdf = "asdf";
-const OUString dot = ".";
-const OUString goto_ = "goto";
-const OUString excl = "!";
+constexpr OUString cr = u"\n"_ustr;
+constexpr OUString rem = u"REM"_ustr;
+constexpr OUString asdf = u"asdf"_ustr;
+constexpr OUString dot = u"."_ustr;
+constexpr OUString goto_ = u"goto"_ustr;
+constexpr OUString excl = u"!"_ustr;
std::vector<Symbol> getSymbols(const OUString& source, sal_Int32& errors, bool bCompatible = false)
{
@@ -160,14 +160,14 @@ void ScannerTest::testBlankLines()
void ScannerTest::testOperators()
{
- const OUString sourceE("=");
- const OUString sourceLT("<");
- const OUString sourceGT(">");
- const OUString sourceLTE("<=");
- const OUString sourceGTE(">=");
- const OUString sourceNE("<>");
- const OUString sourceA(":=");
- const OUString sourceNot("Not");
+ constexpr OUString sourceE(u"="_ustr);
+ constexpr OUString sourceLT(u"<"_ustr);
+ constexpr OUString sourceGT(u">"_ustr);
+ constexpr OUString sourceLTE(u"<="_ustr);
+ constexpr OUString sourceGTE(u">="_ustr);
+ constexpr OUString sourceNE(u"<>"_ustr);
+ constexpr OUString sourceA(u":="_ustr);
+ constexpr OUString sourceNot(u"Not"_ustr);
std::vector<Symbol> symbols;
@@ -239,12 +239,12 @@ void ScannerTest::testOperators()
void ScannerTest::testAlphanum()
{
- const OUString source1("asdfghefg");
- const OUString source3("AdfsaAUdsl10987");
- const OUString source4("asdfa_mnvcnm");
- const OUString source5("_asdf1");
- const OUString source6("_6");
- const OUString source7("joxclk_");
+ constexpr OUString source1(u"asdfghefg"_ustr);
+ constexpr OUString source3(u"AdfsaAUdsl10987"_ustr);
+ constexpr OUString source4(u"asdfa_mnvcnm"_ustr);
+ constexpr OUString source5(u"_asdf1"_ustr);
+ constexpr OUString source6(u"_6"_ustr);
+ constexpr OUString source7(u"joxclk_"_ustr);
std::vector<Symbol> symbols;