diff options
author | sb <sb@openoffice.org> | 2010-09-16 17:12:35 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-09-16 17:12:35 +0200 |
commit | d809bc2e320871025c47fe6e016d318b4a542678 (patch) | |
tree | a586346b0871c03235ad76009b58680d8809fa9f /test | |
parent | sb123: merged in DEV300_m87 (diff) | |
parent | sb126: merged in DEV300_m87 (diff) | |
download | core-d809bc2e320871025c47fe6e016d318b4a542678.tar.gz core-d809bc2e320871025c47fe6e016d318b4a542678.zip |
sb123: merged in cws/sb126, to get fixes for i107490 and i113115
Diffstat (limited to 'test')
-rw-r--r-- | test/inc/test/uniquepipename.hxx | 44 | ||||
-rw-r--r-- | test/prj/d.lst | 1 | ||||
-rw-r--r-- | test/source/cpp/makefile.mk | 3 | ||||
-rw-r--r-- | test/source/cpp/officeconnection.cxx | 11 | ||||
-rw-r--r-- | test/source/cpp/uniquepipename.cxx | 48 |
5 files changed, 99 insertions, 8 deletions
diff --git a/test/inc/test/uniquepipename.hxx b/test/inc/test/uniquepipename.hxx new file mode 100644 index 000000000000..4b96586a0299 --- /dev/null +++ b/test/inc/test/uniquepipename.hxx @@ -0,0 +1,44 @@ +/************************************************************************* +* +* 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. +* +************************************************************************/ + +#ifndef INCLUDED_TEST_UNIQUEPIPENAME_HXX +#define INCLUDED_TEST_UNIQUEPIPENAME_HXX + +#include "sal/config.h" + +#include "test/detail/testdllapi.hxx" + +namespace rtl { class OUString; } + +namespace test { + +// Create a system-wide unique name (for use with osl::Pipe): +OOO_DLLPUBLIC_TEST rtl::OUString uniquePipeName(rtl::OUString const & name); + +} + +#endif diff --git a/test/prj/d.lst b/test/prj/d.lst index 34218f54e974..48f9d8edba0c 100644 --- a/test/prj/d.lst +++ b/test/prj/d.lst @@ -9,4 +9,5 @@ mkdir: %_DEST%\inc%_EXT%\test\detail ..\inc\test\officeconnection.hxx %_DEST%\inc%_EXT%\test\officeconnection.hxx ..\inc\test\oustringostreaminserter.hxx %_DEST%\inc%_EXT%\test\oustringostreaminserter.hxx ..\inc\test\toabsolutefileurl.hxx %_DEST%\inc%_EXT%\test\toabsolutefileurl.hxx +..\inc\test\uniquepipename.hxx %_DEST%\inc%_EXT%\test\uniquepipename.hxx ..\%__SRC%\class\test.jar %_DEST%\bin%_EXT%\test.jar diff --git a/test/source/cpp/makefile.mk b/test/source/cpp/makefile.mk index 52f8f7ab9db5..4c90dc678959 100644 --- a/test/source/cpp/makefile.mk +++ b/test/source/cpp/makefile.mk @@ -46,7 +46,8 @@ SLOFILES = \ $(SLO)/getargument.obj \ $(SLO)/gettestargument.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 d460d9c73b8b..ca62a5c93c2b 100644 --- a/test/source/cpp/officeconnection.cxx +++ b/test/source/cpp/officeconnection.cxx @@ -41,6 +41,7 @@ #include "sal/types.h" #include "test/officeconnection.hxx" #include "test/toabsolutefileurl.hxx" +#include "test/uniquepipename.hxx" #include "getargument.hxx" @@ -64,13 +65,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)); +} + +} |