From c87ecb0e18b11bc8ff4043ae17be097c73faf2d1 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 19 Nov 2016 20:35:07 +0100 Subject: remove dep on unotest from osl_Pipe test Change-Id: I5f5862a684e52bd3d1336fa9f8cffa77cdebbe4c --- include/osl/test/uniquepipename.hxx | 41 +++++++++++++++++++++++++++++++++ include/unotest/uniquepipename.hxx | 37 ----------------------------- sal/CppunitTest_sal_osl_pipe.mk | 1 - sal/qa/osl/pipe/osl_Pipe.cxx | 2 +- unotest/Library_unotest.mk | 1 - unotest/source/cpp/officeconnection.cxx | 4 ++-- unotest/source/cpp/uniquepipename.cxx | 40 -------------------------------- 7 files changed, 44 insertions(+), 82 deletions(-) create mode 100644 include/osl/test/uniquepipename.hxx delete mode 100644 include/unotest/uniquepipename.hxx delete mode 100644 unotest/source/cpp/uniquepipename.cxx diff --git a/include/osl/test/uniquepipename.hxx b/include/osl/test/uniquepipename.hxx new file mode 100644 index 000000000000..bdffb28ca2c0 --- /dev/null +++ b/include/osl/test/uniquepipename.hxx @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include "sal/types.h" +#include "cppunit/TestAssert.h" +#include "osl/process.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" + +namespace osl { +namespace test { + +OUString uniquePipeName(OUString const & name) { + oslProcessInfo info; + info.Size = sizeof info; + CPPUNIT_ASSERT_EQUAL( + osl_Process_E_None, + osl_getProcessInfo(nullptr, osl_Process_IDENTIFIER, &info)); + return name + OUString::number(info.Ident); +} + +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/unotest/uniquepipename.hxx b/include/unotest/uniquepipename.hxx deleted file mode 100644 index f406dc1dd69b..000000000000 --- a/include/unotest/uniquepipename.hxx +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UNOTEST_UNIQUEPIPENAME_HXX -#define INCLUDED_UNOTEST_UNIQUEPIPENAME_HXX - -#include - -#include -#include - -namespace test { - -// Create a system-wide unique name (for use with osl::Pipe): -OOO_DLLPUBLIC_UNOTEST OUString uniquePipeName(OUString const & name); - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/CppunitTest_sal_osl_pipe.mk b/sal/CppunitTest_sal_osl_pipe.mk index 932a1381cd48..cf909ea2090e 100644 --- a/sal/CppunitTest_sal_osl_pipe.mk +++ b/sal/CppunitTest_sal_osl_pipe.mk @@ -15,7 +15,6 @@ $(eval $(call gb_CppunitTest_add_exception_objects,sal_osl_pipe, \ $(eval $(call gb_CppunitTest_use_libraries,sal_osl_pipe, \ sal \ - unotest \ $(gb_UWINAPI) \ )) diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index 543b730e05c2..3e7276350397 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -24,9 +24,9 @@ #include "cppunit/TestFixture.h" #include "cppunit/extensions/HelperMacros.h" #include "cppunit/plugin/TestPlugIn.h" -#include "unotest/uniquepipename.hxx" #include +#include #include #include diff --git a/unotest/Library_unotest.mk b/unotest/Library_unotest.mk index 315447cd6dd0..558b8a745361 100644 --- a/unotest/Library_unotest.mk +++ b/unotest/Library_unotest.mk @@ -39,7 +39,6 @@ $(eval $(call gb_Library_add_exception_objects,unotest,\ unotest/source/cpp/macros_test \ unotest/source/cpp/officeconnection \ unotest/source/cpp/toabsolutefileurl \ - unotest/source/cpp/uniquepipename \ )) # vim: set noet sw=4 ts=4: diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx index 326b3325868e..51cc6df8de3d 100644 --- a/unotest/source/cpp/officeconnection.cxx +++ b/unotest/source/cpp/officeconnection.cxx @@ -27,12 +27,12 @@ #include "cppuhelper/bootstrap.hxx" #include "cppunit/TestAssert.h" #include "osl/process.h" +#include "osl/test/uniquepipename.hxx" #include "osl/time.h" #include "sal/macros.h" #include "sal/types.h" #include "unotest/officeconnection.hxx" #include "unotest/toabsolutefileurl.hxx" -#include "unotest/uniquepipename.hxx" #include "getargument.hxx" @@ -53,7 +53,7 @@ void OfficeConnection::setUp() { "soffice", &argSoffice)); if (argSoffice.match("path:")) { - desc = "pipe,name=" + uniquePipeName("oootest"); + desc = "pipe,name=" + osl::test::uniquePipeName("oootest"); OUString noquickArg("--quickstart=no"); OUString norestoreArg("--norestore"); OUString nologoArg("--nologo"); diff --git a/unotest/source/cpp/uniquepipename.cxx b/unotest/source/cpp/uniquepipename.cxx deleted file mode 100644 index ed6edcb2a46b..000000000000 --- a/unotest/source/cpp/uniquepipename.cxx +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "sal/types.h" -#include "cppunit/TestAssert.h" -#include "osl/process.h" -#include "rtl/ustring.h" -#include "rtl/ustring.hxx" -#include "unotest/uniquepipename.hxx" - -namespace test { - -OUString uniquePipeName(OUString const & name) { - oslProcessInfo info; - info.Size = sizeof info; - CPPUNIT_ASSERT_EQUAL( - osl_Process_E_None, - osl_getProcessInfo(nullptr, osl_Process_IDENTIFIER, &info)); - return name + OUString::number(info.Ident); -} - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit