summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /unotest
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/cpp/directories.cxx8
-rw-r--r--unotest/source/cpp/filters-test.cxx8
-rw-r--r--unotest/source/cpp/getargument.cxx4
-rw-r--r--unotest/source/cpp/getargument.hxx4
-rw-r--r--unotest/source/cpp/gettestargument.cxx4
-rw-r--r--unotest/source/cpp/macros_test.cxx5
-rw-r--r--unotest/source/cpp/officeconnection.cxx6
7 files changed, 21 insertions, 18 deletions
diff --git a/unotest/source/cpp/directories.cxx b/unotest/source/cpp/directories.cxx
index 54f106b212d6..93bcd4daed6d 100644
--- a/unotest/source/cpp/directories.cxx
+++ b/unotest/source/cpp/directories.cxx
@@ -43,22 +43,22 @@ test::Directories::Directories()
m_aWorkdirRootURL = getFileURLFromSystemPath(m_aWorkdirRootPath);
}
-OUString test::Directories::getURLFromSrc(const OUString& rPath) const
+OUString test::Directories::getURLFromSrc(std::u16string_view rPath) const
{
return m_aSrcRootURL + rPath;
}
-OUString test::Directories::getPathFromSrc(const OUString& rPath) const
+OUString test::Directories::getPathFromSrc(std::u16string_view rPath) const
{
return m_aSrcRootPath + rPath;
}
-OUString test::Directories::getURLFromWorkdir(const OUString& rPath) const
+OUString test::Directories::getURLFromWorkdir(std::u16string_view rPath) const
{
return m_aWorkdirRootURL + rPath;
}
-OUString test::Directories::getPathFromWorkdir(const OUString& rPath) const
+OUString test::Directories::getPathFromWorkdir(std::u16string_view rPath) const
{
return m_aWorkdirRootPath + rPath;
}
diff --git a/unotest/source/cpp/filters-test.cxx b/unotest/source/cpp/filters-test.cxx
index be5ee711b9be..a642c2176678 100644
--- a/unotest/source/cpp/filters-test.cxx
+++ b/unotest/source/cpp/filters-test.cxx
@@ -149,18 +149,18 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
}
void FiltersTest::testDir(const OUString &rFilter,
- const OUString &rURL, const OUString &rUserData,
+ std::u16string_view rURL, const OUString &rUserData,
SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
unsigned int nFilterVersion, bool bExport)
{
recursiveScan(test::pass, rFilter,
- rURL + "pass",
+ OUString::Concat(rURL) + "pass",
rUserData, nFilterFlags, nClipboardID, nFilterVersion, bExport);
recursiveScan(test::fail, rFilter,
- rURL + "fail",
+ OUString::Concat(rURL) + "fail",
rUserData, nFilterFlags, nClipboardID, nFilterVersion, bExport);
recursiveScan(test::indeterminate, rFilter,
- rURL + "indeterminate",
+ OUString::Concat(rURL) + "indeterminate",
rUserData, nFilterFlags, nClipboardID, nFilterVersion, bExport);
}
diff --git a/unotest/source/cpp/getargument.cxx b/unotest/source/cpp/getargument.cxx
index cb1df427758e..5c40a0a324b4 100644
--- a/unotest/source/cpp/getargument.cxx
+++ b/unotest/source/cpp/getargument.cxx
@@ -27,10 +27,10 @@
namespace test::detail
{
-bool getArgument(OUString const& name, OUString* value)
+bool getArgument(std::u16string_view name, OUString* value)
{
OSL_ASSERT(value != nullptr);
- return rtl::Bootstrap::get("arg-" + name, *value);
+ return rtl::Bootstrap::get(OUString::Concat("arg-") + name, *value);
}
}
diff --git a/unotest/source/cpp/getargument.hxx b/unotest/source/cpp/getargument.hxx
index 97f2b89f32d1..e72eb59438a0 100644
--- a/unotest/source/cpp/getargument.hxx
+++ b/unotest/source/cpp/getargument.hxx
@@ -22,6 +22,8 @@
#include <sal/config.h>
+#include <string_view>
+
#include <rtl/ustring.hxx>
namespace test {
@@ -31,7 +33,7 @@ namespace detail {
// Obtain the value of an argument tunneled in via an "arg-<name>" bootstrap
// variable:
bool getArgument(
- OUString const & name, OUString * value);
+ std::u16string_view name, OUString * value);
}
diff --git a/unotest/source/cpp/gettestargument.cxx b/unotest/source/cpp/gettestargument.cxx
index 1c69cc9c6196..915ea5690e82 100644
--- a/unotest/source/cpp/gettestargument.cxx
+++ b/unotest/source/cpp/gettestargument.cxx
@@ -26,9 +26,9 @@
namespace test
{
-bool getTestArgument(OUString const& name, OUString* value)
+bool getTestArgument(std::u16string_view name, OUString* value)
{
- return detail::getArgument("testarg." + name, value);
+ return detail::getArgument(OUString(OUString::Concat("testarg.") + name), value);
}
}
diff --git a/unotest/source/cpp/macros_test.cxx b/unotest/source/cpp/macros_test.cxx
index a6d690e0d2c1..35788df70d2b 100644
--- a/unotest/source/cpp/macros_test.cxx
+++ b/unotest/source/cpp/macros_test.cxx
@@ -87,8 +87,9 @@ void MacrosTest::dispatchCommand(const uno::Reference<lang::XComponent>& xCompon
void MacrosTest::setUpNssGpg(const test::Directories& rDirectories, const OUString& rTestName)
{
- OUString aSourceDir = rDirectories.getURLFromSrc("/test/signing-keys/");
- OUString aTargetDir = rDirectories.getURLFromWorkdir("CppunitTest/" + rTestName + ".test.user");
+ OUString aSourceDir = rDirectories.getURLFromSrc(u"/test/signing-keys/");
+ OUString aTargetDir
+ = rDirectories.getURLFromWorkdir(OUString("CppunitTest/" + rTestName + ".test.user"));
// Set up cert8.db in workdir/CppunitTest/
osl::File::copy(aSourceDir + "cert8.db", aTargetDir + "/cert8.db");
diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx
index fbd63f385abe..55525736f346 100644
--- a/unotest/source/cpp/officeconnection.cxx
+++ b/unotest/source/cpp/officeconnection.cxx
@@ -49,7 +49,7 @@ void OfficeConnection::setUp() {
OUString argSoffice;
CPPUNIT_ASSERT(
detail::getArgument(
- "soffice",
+ u"soffice",
&argSoffice));
if (argSoffice.match("path:")) {
desc = "pipe,name=" + osl::test::uniquePipeName("oootest");
@@ -62,7 +62,7 @@ void OfficeConnection::setUp() {
OUString acceptArg("--accept=" + desc + ";urp");
OUString argUser;
CPPUNIT_ASSERT(
- detail::getArgument("user", &argUser));
+ detail::getArgument(u"user", &argUser));
OUString userArg("-env:UserInstallation=" + toAbsoluteFileUrl(argUser));
OUString jreArg(
"-env:UNO_JAVA_JFW_ENV_JREHOME=true");
@@ -72,7 +72,7 @@ void OfficeConnection::setUp() {
jreArg.pData };
rtl_uString ** envs = nullptr;
OUString argEnv;
- if (detail::getArgument("env", &argEnv))
+ if (detail::getArgument(u"env", &argEnv))
{
envs = &argEnv.pData;
}