include/test/sheet/xmultiformulatokens.hxx | 39 +++++++++++++++++++++++++ sc/qa/extras/sctablevalidationobj.cxx | 6 +++ test/Library_subsequenttest.mk | 1 test/source/sheet/xmultiformulatokens.cxx | 44 +++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+)
New commits: commit 059a958a65e064b701a74f6cb87e295b13ffbd0e Author: Jens Carl <j.car...@gmx.de> AuthorDate: Fri Jan 25 03:16:29 2019 +0000 Commit: Jens Carl <j.car...@gmx.de> CommitDate: Fri Jan 25 14:55:18 2019 +0100 Add XMultiFormulaTokens tests to ScTableValidationObj Change-Id: I6239cfba2b275c5f0b8794e30d57d1835ed569fa Reviewed-on: https://gerrit.libreoffice.org/66892 Tested-by: Jenkins Reviewed-by: Jens Carl <j.car...@gmx.de> diff --git a/include/test/sheet/xmultiformulatokens.hxx b/include/test/sheet/xmultiformulatokens.hxx new file mode 100644 index 000000000000..8f883a32071b --- /dev/null +++ b/include/test/sheet/xmultiformulatokens.hxx @@ -0,0 +1,39 @@ +/* -*- 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_SHEET_XMULTIFORMULATOKENS_HXX +#define INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX + +#include <com/sun/star/uno/XInterface.hpp> + +#include <com/sun/star/uno/Reference.hxx> + +#include <test/testdllapi.hxx> + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XMultiFormulaTokens +{ +public: + virtual css::uno::Reference<css::uno::XInterface> init() = 0; + virtual void setUp() = 0; + virtual void tearDown() = 0; + + void testGetCount(); + void testGetSetTokens(); + +protected: + ~XMultiFormulaTokens() {} +}; + +} // namespace apitest + +#endif // INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/qa/extras/sctablevalidationobj.cxx b/sc/qa/extras/sctablevalidationobj.cxx index e2fed2e9ca2e..6eb5e58d2987 100644 --- a/sc/qa/extras/sctablevalidationobj.cxx +++ b/sc/qa/extras/sctablevalidationobj.cxx @@ -12,6 +12,7 @@ #include <test/lang/xserviceinfo.hxx> #include <test/sheet/tablevalidation.hxx> #include <test/sheet/xsheetcondition.hxx> +#include <test/sheet/xmultiformulatokens.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -33,6 +34,7 @@ namespace sc_apitest { class ScTableValidationObj : public CalcUnoApiTest, public apitest::TableValidation, + public apitest::XMultiFormulaTokens, public apitest::XPropertySet, public apitest::XServiceInfo, public apitest::XSheetCondition @@ -49,6 +51,10 @@ public: // TableValidation CPPUNIT_TEST(testTableValidationProperties); + // XMultiFormulaTokens + CPPUNIT_TEST(testGetCount); + CPPUNIT_TEST(testGetSetTokens); + // XPropertySet CPPUNIT_TEST(testGetPropertySetInfo); CPPUNIT_TEST(testSetPropertyValue); diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 5ea8ade69775..e3f3bce700bb 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -113,6 +113,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/sheet/xheaderfootercontent \ test/source/sheet/xlabelrange \ test/source/sheet/xlabelranges \ + test/source/sheet/xmultiformulatokens \ test/source/sheet/xmultipleoperation \ test/source/sheet/xnamedrange \ test/source/sheet/xnamedranges \ diff --git a/test/source/sheet/xmultiformulatokens.cxx b/test/source/sheet/xmultiformulatokens.cxx new file mode 100644 index 000000000000..3478c0188602 --- /dev/null +++ b/test/source/sheet/xmultiformulatokens.cxx @@ -0,0 +1,44 @@ +/* -*- 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/xmultiformulatokens.hxx> + +#include <com/sun/star/sheet/FormulaToken.hpp> +#include <com/sun/star/sheet/XMultiFormulaTokens.hpp> + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +#include <cppunit/extensions/HelperMacros.h> + +using namespace css; + +namespace apitest +{ +void XMultiFormulaTokens::testGetCount() +{ + uno::Reference<sheet::XMultiFormulaTokens> xMFT(init(), uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xMFT->getCount()); +} + +void XMultiFormulaTokens::testGetSetTokens() +{ + uno::Reference<sheet::XMultiFormulaTokens> xMFT(init(), uno::UNO_QUERY_THROW); + + uno::Sequence<sheet::FormulaToken> aTokens(1); + aTokens[0].OpCode = 2; + xMFT->setTokens(0, aTokens); + + CPPUNIT_ASSERT_EQUAL(aTokens[0].OpCode, xMFT->getTokens(0)[0].OpCode); +} + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits