From 44e9640748791f602edb22cbc499200283466e1e Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Wed, 1 Nov 2017 23:55:50 +0000 Subject: tdf#45904 Move Java _XSheetConditionalEntries test to C++ Change-Id: I96c1b0dc8d6c6b9cc4f8e02ef8c9ca184fb4d6a4 Reviewed-on: https://gerrit.libreoffice.org/44184 Tested-by: Jenkins Reviewed-by: Jens Carl --- test/Library_subsequenttest.mk | 1 + test/source/sheet/xsheetconditionalentries.cxx | 59 ++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 test/source/sheet/xsheetconditionalentries.cxx (limited to 'test') diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 21c5881ceca0..e6f0c99e4985 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/xsheetconditionalentries \ test/source/sheet/xsheetconditionalentry \ test/source/sheet/xsheetcondition \ test/source/sheet/xsheetfilterable \ diff --git a/test/source/sheet/xsheetconditionalentries.cxx b/test/source/sheet/xsheetconditionalentries.cxx new file mode 100644 index 000000000000..e22f3b8195e9 --- /dev/null +++ b/test/source/sheet/xsheetconditionalentries.cxx @@ -0,0 +1,59 @@ +/* -*- 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 + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace apitest { + +void XSheetConditionalEntries::testAddNew() +{ + uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries(init(), UNO_QUERY_THROW); + const sal_Int32 aCount = xSheetConditionalEntries->getCount(); + + xSheetConditionalEntries->addNew(createCondition(4)); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to add new condition", + aCount + 1, xSheetConditionalEntries->getCount()); + +} + +void XSheetConditionalEntries::testClear() +{ + uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries(init(), UNO_QUERY_THROW); + xSheetConditionalEntries->clear(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to clear conditions", + sal_Int32(0), xSheetConditionalEntries->getCount()); +} + +void XSheetConditionalEntries::testRemoveByIndex() +{ + uno::Reference< sheet::XSheetConditionalEntries > xSheetConditionalEntries(init(), UNO_QUERY_THROW); + const sal_Int32 aCount = xSheetConditionalEntries->getCount(); + + xSheetConditionalEntries->removeByIndex(0); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove condition", + aCount - 1, xSheetConditionalEntries->getCount()); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit