summaryrefslogtreecommitdiff
path: root/test/source
diff options
context:
space:
mode:
Diffstat (limited to 'test/source')
-rw-r--r--test/source/cpp/makefile.mk3
-rw-r--r--test/source/cpp/officeconnection.cxx11
-rw-r--r--test/source/cpp/uniquepipename.cxx48
3 files changed, 54 insertions, 8 deletions
diff --git a/test/source/cpp/makefile.mk b/test/source/cpp/makefile.mk
index 04eedea3c670..9561be25fc1f 100644
--- a/test/source/cpp/makefile.mk
+++ b/test/source/cpp/makefile.mk
@@ -45,7 +45,8 @@ CFLAGSCXX+=-DADAPT_EXT_STL
SLOFILES = \
$(SLO)/getargument.obj \
$(SLO)/officeconnection.obj \
- $(SLO)/toabsolutefileurl.obj
+ $(SLO)/toabsolutefileurl.obj \
+ $(SLO)/uniquepipename.obj
SHL1IMPLIB = i$(SHL1TARGET)
SHL1OBJS = $(SLOFILES)
diff --git a/test/source/cpp/officeconnection.cxx b/test/source/cpp/officeconnection.cxx
index b77fb59e4fff..85c1b855f88b 100644
--- a/test/source/cpp/officeconnection.cxx
+++ b/test/source/cpp/officeconnection.cxx
@@ -42,6 +42,7 @@
#include "test/getargument.hxx"
#include "test/officeconnection.hxx"
#include "test/toabsolutefileurl.hxx"
+#include "test/uniquepipename.hxx"
namespace {
@@ -63,13 +64,9 @@ void OfficeConnection::setUp() {
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice")),
&argSoffice));
if (argSoffice.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("path:"))) {
- oslProcessInfo info;
- info.Size = sizeof info;
- CPPUNIT_ASSERT_EQUAL(
- osl_Process_E_None,
- osl_getProcessInfo(0, osl_Process_IDENTIFIER, &info));
- desc = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pipe,name=oootest")) +
- rtl::OUString::valueOf(static_cast< sal_Int64 >(info.Ident));
+ desc = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pipe,name=")) +
+ uniquePipeName(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("oootest")));
rtl::OUString noquickArg(
RTL_CONSTASCII_USTRINGPARAM("-quickstart=no"));
rtl::OUString nofirstArg(
diff --git a/test/source/cpp/uniquepipename.cxx b/test/source/cpp/uniquepipename.cxx
new file mode 100644
index 000000000000..c7614f4f3216
--- /dev/null
+++ b/test/source/cpp/uniquepipename.cxx
@@ -0,0 +1,48 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "sal/config.h"
+
+#include "cppunit/TestAssert.h"
+#include "osl/process.h"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+#include "test/uniquepipename.hxx"
+
+namespace test {
+
+rtl::OUString uniquePipeName(rtl::OUString const & name) {
+ oslProcessInfo info;
+ info.Size = sizeof info;
+ CPPUNIT_ASSERT_EQUAL(
+ osl_Process_E_None,
+ osl_getProcessInfo(0, osl_Process_IDENTIFIER, &info));
+ return name + rtl::OUString::valueOf(static_cast< sal_Int64 >(info.Ident));
+}
+
+}