From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- include/test/container/xchild.hxx | 34 +++++++++++++++ include/test/container/xelementaccess.hxx | 46 ++++++++++++++++++++ include/test/container/xenumeration.hxx | 36 ++++++++++++++++ include/test/container/xenumerationaccess.hxx | 34 +++++++++++++++ include/test/container/xindexaccess.hxx | 46 ++++++++++++++++++++ include/test/container/xnameaccess.hxx | 46 ++++++++++++++++++++ include/test/container/xnamecontainer.hxx | 60 +++++++++++++++++++++++++++ include/test/container/xnamed.hxx | 50 ++++++++++++++++++++++ include/test/container/xnamereplace.hxx | 48 +++++++++++++++++++++ 9 files changed, 400 insertions(+) create mode 100644 include/test/container/xchild.hxx create mode 100644 include/test/container/xelementaccess.hxx create mode 100644 include/test/container/xenumeration.hxx create mode 100644 include/test/container/xenumerationaccess.hxx create mode 100644 include/test/container/xindexaccess.hxx create mode 100644 include/test/container/xnameaccess.hxx create mode 100644 include/test/container/xnamecontainer.hxx create mode 100644 include/test/container/xnamed.hxx create mode 100644 include/test/container/xnamereplace.hxx (limited to 'include/test/container') diff --git a/include/test/container/xchild.hxx b/include/test/container/xchild.hxx new file mode 100644 index 000000000..60efed6fc --- /dev/null +++ b/include/test/container/xchild.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* 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/. +*/ + +#ifndef INCLUDED_TEST_CONTAINER_XCHILD_HXX +#define INCLUDED_TEST_CONTAINER_XCHILD_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XChild +{ +public: + virtual css::uno::Reference init() = 0; + + void testGetSetParent(); + +protected: + ~XChild() {} +}; +} + +#endif // INCLUDED_TEST_CONTAINER_XCHILD_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xelementaccess.hxx b/include/test/container/xelementaccess.hxx new file mode 100644 index 000000000..95ee85162 --- /dev/null +++ b/include/test/container/xelementaccess.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XELEMENTACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XELEMENTACCESS_HXX + +#include + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XElementAccess +{ +public: + XElementAccess(css::uno::Type const& rType) + : m_aType(rType) + { + } + + void testGetElementType(); + void testHasElements(); + + virtual css::uno::Reference init() = 0; + +protected: + ~XElementAccess() {} + +private: + css::uno::Type m_aType; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XELEMENTACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xenumeration.hxx b/include/test/container/xenumeration.hxx new file mode 100644 index 000000000..0d39a0dc9 --- /dev/null +++ b/include/test/container/xenumeration.hxx @@ -0,0 +1,36 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XENUMERATION_HXX +#define INCLUDED_TEST_CONTAINER_XENUMERATION_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XEnumeration +{ +public: + virtual css::uno::Reference init() = 0; + + void testHasMoreElements(); + void testNextElement(); + +protected: + ~XEnumeration() {} +}; +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XENUMERATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xenumerationaccess.hxx b/include/test/container/xenumerationaccess.hxx new file mode 100644 index 000000000..272172c8d --- /dev/null +++ b/include/test/container/xenumerationaccess.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* +* 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/. +*/ + +#ifndef INCLUDED_TEST_CONTAINER_XENUMERATIONACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XENUMERATIONACCESS_HXX + +#include +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XEnumerationAccess +{ +public: + virtual css::uno::Reference init() = 0; + + void testCreateEnumeration(); + +protected: + ~XEnumerationAccess() {} +}; +} + +#endif // INCLUDED_TEST_CONTAINER_XENUMERATIONACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xindexaccess.hxx b/include/test/container/xindexaccess.hxx new file mode 100644 index 000000000..64a34b8bf --- /dev/null +++ b/include/test/container/xindexaccess.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XIndexAccess +{ +public: + XIndexAccess(sal_Int32 nItems) + : m_nItems(nItems) + { + } + + virtual css::uno::Reference init() = 0; + void testGetCount(); + void testGetByIndex(); + // will throw an exception and should fail if not + void testGetByIndexException(); + +protected: + ~XIndexAccess() {} + +private: + sal_Int32 m_nItems; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XINDEXACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xnameaccess.hxx b/include/test/container/xnameaccess.hxx new file mode 100644 index 000000000..960cf6782 --- /dev/null +++ b/include/test/container/xnameaccess.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMEACCESS_HXX +#define INCLUDED_TEST_CONTAINER_XNAMEACCESS_HXX + +#include + +#include + +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNameAccess +{ +public: + XNameAccess(const OUString& rName) + : m_aName(rName) + { + } + + virtual css::uno::Reference init() = 0; + + void testGetByName(); + void testGetElementNames(); + void testHasByName(); + +protected: + ~XNameAccess() {} + +private: + OUString const m_aName; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XNAMEACCESS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xnamecontainer.hxx b/include/test/container/xnamecontainer.hxx new file mode 100644 index 000000000..221ef2a44 --- /dev/null +++ b/include/test/container/xnamecontainer.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX +#define INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX + +#include +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNameContainer +{ +public: + // removes default entry + XNameContainer() + : m_aName("XNameContainer") + { + } + // removes given entry + XNameContainer(const OUString& rNameToRemove) + : m_aName(rNameToRemove) + { + } + + virtual css::uno::Reference init() = 0; + virtual void setElement(const css::uno::Any& rElement) { m_aElement = rElement; } + + void testInsertByName(); + void testInsertByNameEmptyName(); + void testInsertByNameDuplicate(); + void testInsertByNameInvalidElement(); + void testRemoveByName(); + void testRemoveByNameEmptyName(); + void testRemoveByNameNoneExistingElement(); + +protected: + ~XNameContainer() {} + +private: + OUString m_aName; + css::uno::Any m_aElement; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/test/container/xnamed.hxx b/include/test/container/xnamed.hxx new file mode 100644 index 000000000..2b323e6f9 --- /dev/null +++ b/include/test/container/xnamed.hxx @@ -0,0 +1,50 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMED_HXX +#define INCLUDED_TEST_CONTAINER_XNAMED_HXX + +#include + +#include + +#include + +#include + +namespace apitest { + +class OOO_DLLPUBLIC_TEST XNamed +{ +public: + XNamed(const OUString& rTestName) + : m_aTestName(rTestName) + { + } + + void testGetName(); + void testSetName(); + // special case, here name is equal to links URL + void testSetNameByScSheetLinkObj(); + void testSetNameThrowsException(); + + virtual css::uno::Reference< css::uno::XInterface > init() = 0; + +protected: + ~XNamed() {} + +private: + OUString m_aTestName; +}; + +} + +#endif // INCLUDED_TEST_CONTAINER_XNAMED_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/test/container/xnamereplace.hxx b/include/test/container/xnamereplace.hxx new file mode 100644 index 000000000..ecf2fac83 --- /dev/null +++ b/include/test/container/xnamereplace.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_TEST_CONTAINER_XNAMEREPLACE_HXX +#define INCLUDED_TEST_CONTAINER_XNAMEREPLACE_HXX + +#include +#include + +#include + +#include +#include + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XNameReplace +{ +public: + XNameReplace(const OUString& rName) + : m_aReplacementName(rName) + { + } + + virtual css::uno::Reference init() = 0; + void testReplaceByName(); + + void setElement(const css::uno::Any& rElement) { m_aReplacementElement = rElement; } + +protected: + ~XNameReplace() {} + +private: + OUString m_aReplacementName; + css::uno::Any m_aReplacementElement; +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_CONTAINER_XNAMEREPLACE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit v1.2.3