diff options
author | Jens Carl <j.carl43@gmx.de> | 2017-11-02 08:14:14 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2017-11-03 04:10:14 +0100 |
commit | bda85f9563b03bb36c7d72dc1178661b3bf23df0 (patch) | |
tree | 4b5a926bcccfc276e88eec808af5064c78b794fe /test | |
parent | 44e9640748791f602edb22cbc499200283466e1e (diff) |
tdf#45904 Move Java _XSheetCellRanges tests to C++
Change-Id: I6f6dcbc5368ce034c25553edf8b88c6669074243
Reviewed-on: https://gerrit.libreoffice.org/44194
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'test')
-rw-r--r-- | test/Library_subsequenttest.mk | 1 | ||||
-rw-r--r-- | test/source/sheet/xsheetcellranges.cxx | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index e6f0c99e4985..0435b967dd5d 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -70,6 +70,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/sheet/xsheetannotation \ test/source/sheet/xsheetannotations \ test/source/sheet/xsheetannotationshapesupplier \ + test/source/sheet/xsheetcellranges \ test/source/sheet/xsheetconditionalentries \ test/source/sheet/xsheetconditionalentry \ test/source/sheet/xsheetcondition \ diff --git a/test/source/sheet/xsheetcellranges.cxx b/test/source/sheet/xsheetcellranges.cxx new file mode 100644 index 000000000000..0b590ad249a8 --- /dev/null +++ b/test/source/sheet/xsheetcellranges.cxx @@ -0,0 +1,52 @@ +/* -*- 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 <test/sheet/xsheetcellranges.hxx> + +#include <com/sun/star/container/XEnumeration.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/sheet/XSheetCellRanges.hpp> +#include <com/sun/star/table/CellRangeAddress.hpp> + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +#include <cppunit/extensions/HelperMacros.h> + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace apitest { + +void XSheetCellRanges::testGetCells() +{ + uno::Reference< sheet::XSheetCellRanges > xSheetCellRanges(init(), UNO_QUERY_THROW); + uno::Reference< container::XEnumerationAccess > xEA = xSheetCellRanges->getCells(); + + CPPUNIT_ASSERT_MESSAGE("Unable to get cells", xEA->hasElements()); +} + +void XSheetCellRanges::testGetRangeAddresses() +{ + uno::Reference< sheet::XSheetCellRanges > xSheetCellRanges(init(), UNO_QUERY_THROW); + uno::Sequence< table::CellRangeAddress > aCellRangeAddress = xSheetCellRanges->getRangeAddresses(); + CPPUNIT_ASSERT_MESSAGE("Unable to get RangeAddresses", + aCellRangeAddress.getLength() > 2); +} + +void XSheetCellRanges::testGetRangeAddressesAsString() +{ + uno::Reference< sheet::XSheetCellRanges > xSheetCellRanges(init(), UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("Unable to get RangeAddresses (string)", + xSheetCellRanges->getRangeAddressesAsString().indexOf("C1:D4") > 0); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |