From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- test/source/sheet/xconsolidationdescriptor.cxx | 143 +++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 test/source/sheet/xconsolidationdescriptor.cxx (limited to 'test/source/sheet/xconsolidationdescriptor.cxx') diff --git a/test/source/sheet/xconsolidationdescriptor.cxx b/test/source/sheet/xconsolidationdescriptor.cxx new file mode 100644 index 0000000000..45ba69877e --- /dev/null +++ b/test/source/sheet/xconsolidationdescriptor.cxx @@ -0,0 +1,143 @@ +/* -*- 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/. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +using namespace css; +using namespace css::uno; + +namespace apitest +{ +void XConsolidationDescriptor::testGetFunction() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get function", sheet::GeneralFunction_SUM, + xConsolidationDescriptor->getFunction()); +} + +void XConsolidationDescriptor::testSetFunction() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + xConsolidationDescriptor->setFunction(sheet::GeneralFunction_COUNT); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set function", sheet::GeneralFunction_COUNT, + xConsolidationDescriptor->getFunction()); +} + +void XConsolidationDescriptor::testGetSources() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + uno::Sequence aSources = xConsolidationDescriptor->getSources(); + CPPUNIT_ASSERT_MESSAGE("Unable to get sources", !aSources.hasElements()); +} + +void XConsolidationDescriptor::testSetSources() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + uno::Sequence aSources{ table::CellRangeAddress(0, 1, 1, 5, 5) }; + xConsolidationDescriptor->setSources(aSources); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set sources", table::CellRangeAddress(0, 1, 1, 5, 5), + xConsolidationDescriptor->getSources()[0]); +} + +void XConsolidationDescriptor::testGetStartOutputPosition() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get start output position", table::CellAddress(0, 0, 0), + xConsolidationDescriptor->getStartOutputPosition()); +} + +void XConsolidationDescriptor::testSetStartOutputPosition() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + xConsolidationDescriptor->setStartOutputPosition(table::CellAddress(0, 1, 2)); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set start output position", table::CellAddress(0, 1, 2), + xConsolidationDescriptor->getStartOutputPosition()); +} + +void XConsolidationDescriptor::testGetUseColumnHeaders() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + CPPUNIT_ASSERT_MESSAGE("Unable to get use column headers", + !xConsolidationDescriptor->getUseColumnHeaders()); +} + +void XConsolidationDescriptor::testSetUseColumnHeaders() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + xConsolidationDescriptor->setUseColumnHeaders(true); + CPPUNIT_ASSERT_MESSAGE("Unable to set use column headers", + xConsolidationDescriptor->getUseColumnHeaders()); +} + +void XConsolidationDescriptor::testGetUseRowHeaders() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + CPPUNIT_ASSERT_MESSAGE("Unable to get use row headers", + !xConsolidationDescriptor->getUseRowHeaders()); +} + +void XConsolidationDescriptor::testSetUseRowHeaders() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + xConsolidationDescriptor->setUseRowHeaders(true); + CPPUNIT_ASSERT_MESSAGE("Unable to set use row headers", + xConsolidationDescriptor->getUseRowHeaders()); +} + +void XConsolidationDescriptor::testGetInsertLinks() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + CPPUNIT_ASSERT_MESSAGE("Unable to get use insert links", + !xConsolidationDescriptor->getInsertLinks()); +} + +void XConsolidationDescriptor::testSetInsertLinks() +{ + uno::Reference xConsolidationDescriptor(init(), + UNO_QUERY_THROW); + + xConsolidationDescriptor->setInsertLinks(true); + CPPUNIT_ASSERT_MESSAGE("Unable to set use insert links", + xConsolidationDescriptor->getInsertLinks()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit v1.2.3