Kaydet (Commit) 484401bb authored tarafından Stephan Bergmann's avatar Stephan Bergmann

unotest: Use appropriate OUString functions on string constants

Change-Id: I449587dd8e6e625e886e4ffc6419c612adffcfde
üst 9c9276c9
...@@ -32,8 +32,7 @@ namespace detail { ...@@ -32,8 +32,7 @@ namespace detail {
bool getArgument(OUString const & name, OUString * value) { bool getArgument(OUString const & name, OUString * value) {
OSL_ASSERT(value != 0); OSL_ASSERT(value != 0);
return rtl::Bootstrap::get( return rtl::Bootstrap::get("arg-" + name, *value);
OUString("arg-") + name, *value);
} }
} }
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
namespace test { namespace test {
bool getTestArgument(OUString const & name, OUString * value) { bool getTestArgument(OUString const & name, OUString * value) {
return detail::getArgument( return detail::getArgument("testarg." + name, value);
OUString("testarg.") + name, value);
} }
} }
......
...@@ -65,9 +65,7 @@ void OfficeConnection::setUp() { ...@@ -65,9 +65,7 @@ void OfficeConnection::setUp() {
OUString argUser; OUString argUser;
CPPUNIT_ASSERT( CPPUNIT_ASSERT(
detail::getArgument(OUString("user"), &argUser)); detail::getArgument(OUString("user"), &argUser));
OUString userArg( OUString userArg("-env:UserInstallation=" + toAbsoluteFileUrl(argUser));
OUString("-env:UserInstallation=") +
toAbsoluteFileUrl(argUser));
OUString jreArg( OUString jreArg(
"-env:UNO_JAVA_JFW_ENV_JREHOME=true"); "-env:UNO_JAVA_JFW_ENV_JREHOME=true");
OUString classpathArg("-env:UNO_JAVA_JFW_ENV_CLASSPATH=true"); OUString classpathArg("-env:UNO_JAVA_JFW_ENV_CLASSPATH=true");
...@@ -101,9 +99,7 @@ void OfficeConnection::setUp() { ...@@ -101,9 +99,7 @@ void OfficeConnection::setUp() {
context_ = context_ =
css::uno::Reference< css::uno::XComponentContext >( css::uno::Reference< css::uno::XComponentContext >(
resolver->resolve( resolver->resolve(
OUString("uno:") + "uno:" + desc + ";urp;StarOffice.ComponentContext"),
desc +
OUString(";urp;StarOffice.ComponentContext")),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
break; break;
} catch (css::connection::NoConnectException &) {} } catch (css::connection::NoConnectException &) {}
......
...@@ -34,15 +34,14 @@ OUString toAbsoluteFileUrl(OUString const & relativePathname) { ...@@ -34,15 +34,14 @@ OUString toAbsoluteFileUrl(OUString const & relativePathname) {
oslProcessError e1 = osl_getProcessWorkingDir(&cwd.pData); oslProcessError e1 = osl_getProcessWorkingDir(&cwd.pData);
if (e1 != osl_Process_E_None) { if (e1 != osl_Process_E_None) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString("osl_getProcessWorkingDir failed with ") + "osl_getProcessWorkingDir failed with " + OUString::number(e1));
OUString::number(e1));
} }
OUString url; OUString url;
osl::FileBase::RC e2 = osl::FileBase::getFileURLFromSystemPath( osl::FileBase::RC e2 = osl::FileBase::getFileURLFromSystemPath(
relativePathname, url); relativePathname, url);
if (e2 != osl::FileBase::E_None) { if (e2 != osl::FileBase::E_None) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString("osl::FileBase::getFileURLFromSystemPath(") + "osl::FileBase::getFileURLFromSystemPath(" +
relativePathname + relativePathname +
") failed with " + ") failed with " +
OUString::number(e2)); OUString::number(e2));
...@@ -51,7 +50,7 @@ OUString toAbsoluteFileUrl(OUString const & relativePathname) { ...@@ -51,7 +50,7 @@ OUString toAbsoluteFileUrl(OUString const & relativePathname) {
e2 = osl::FileBase::getAbsoluteFileURL(cwd, url, absUrl); e2 = osl::FileBase::getAbsoluteFileURL(cwd, url, absUrl);
if (e2 != osl::FileBase::E_None) { if (e2 != osl::FileBase::E_None) {
throw css::uno::RuntimeException( throw css::uno::RuntimeException(
OUString("osl::FileBase::getAbsoluteFileURL(") + "osl::FileBase::getAbsoluteFileURL(" +
cwd + ", " + url + cwd + ", " + url +
") failed with " + ") failed with " +
OUString::number(e2)); OUString::number(e2));
......
...@@ -68,8 +68,7 @@ bool Prot::protect( ...@@ -68,8 +68,7 @@ bool Prot::protect(
context, context,
CppUnit::Message( CppUnit::Message(
convert( convert(
OUString("An uncaught exception of type ") "An uncaught exception of type " + a.getValueTypeName()),
+ a.getValueTypeName()),
convert(e.Message))); convert(e.Message)));
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment