diff options
author | Jens Carl <j.carl43@gmx.de> | 2017-08-06 07:10:36 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-08 07:23:36 +0200 |
commit | 0bd57d62d0f15eced0e99097d9f46a86f177e9a1 (patch) | |
tree | e10ef467edf8cd52eff9310c0713286c0a2e7168 /sc | |
parent | 855af7f3260705faf7c33be36efc1610354336f0 (diff) |
tdf#45904 Move Java _XViewSplitable tests to C++
Change-Id: Ib9cf1c53947d10260673e1e1088bbfbaa30efbc9
Reviewed-on: https://gerrit.libreoffice.org/40801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/CppunitTest_sc_tabviewobj.mk | 105 | ||||
-rw-r--r-- | sc/Module_sc.mk | 1 | ||||
-rw-r--r-- | sc/qa/extras/sctabviewobj.cxx | 92 |
3 files changed, 198 insertions, 0 deletions
diff --git a/sc/CppunitTest_sc_tabviewobj.mk b/sc/CppunitTest_sc_tabviewobj.mk new file mode 100644 index 000000000000..f29a986b2643 --- /dev/null +++ b/sc/CppunitTest_sc_tabviewobj.mk @@ -0,0 +1,105 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# 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/. +# +#************************************************************************* + +$(eval $(call gb_CppunitTest_CppunitTest,sc_tabviewobj)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_tabviewobj, \ + sc/qa/extras/sctabviewobj \ +)) + +$(eval $(call gb_CppunitTest_use_external,sc_tabviewobj,boost_headers)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_tabviewobj, \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + drawinglayer \ + editeng \ + for \ + forui \ + i18nlangtag \ + msfilter \ + oox \ + sal \ + salhelper \ + sax \ + sb \ + sc \ + sfx \ + sot \ + subsequenttest \ + svl \ + svt \ + svx \ + svxcore \ + test \ + tk \ + tl \ + ucbhelper \ + unotest \ + utl \ + vbahelper \ + vcl \ + xo \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_tabviewobj,\ + -I$(SRCDIR)/sc/source/ui/inc \ + -I$(SRCDIR)/sc/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,sc_tabviewobj)) + +$(eval $(call gb_CppunitTest_use_ure,sc_tabviewobj)) +$(eval $(call gb_CppunitTest_use_vcl,sc_tabviewobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_tabviewobj,\ + basic/util/sb \ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + dbaccess/util/dba \ + filter/source/config/cache/filterconfig1 \ + filter/source/storagefilterdetect/storagefd \ + forms/util/frm \ + framework/util/fwk \ + i18npool/util/i18npool \ + linguistic/source/lng \ + oox/util/oox \ + package/source/xstor/xstor \ + package/util/package2 \ + sax/source/expatwrap/expwrap \ + scripting/source/basprov/basprov \ + scripting/util/scriptframe \ + sc/util/sc \ + sc/util/scd \ + sc/util/scfilt \ + $(call gb_Helper_optional,SCRIPTING, \ + sc/util/vbaobj) \ + sfx2/util/sfx \ + sot/util/sot \ + svl/source/fsstor/fsstorage \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + ucb/source/ucp/tdoc/ucptdoc1 \ + unotools/util/utl \ + unoxml/source/rdf/unordf \ + unoxml/source/service/unoxml \ + uui/util/uui \ + xmloff/util/xo \ + svtools/util/svt \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_tabviewobj)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 25c987ff4ae2..03a7565b899d 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -122,6 +122,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ CppunitTest_sc_viewpaneobj \ CppunitTest_sc_cellobj \ CppunitTest_sc_cellcursorobj \ + CppunitTest_sc_tabviewobj \ )) $(eval $(call gb_Module_add_perfcheck_targets,sc,\ diff --git a/sc/qa/extras/sctabviewobj.cxx b/sc/qa/extras/sctabviewobj.cxx new file mode 100644 index 000000000000..7b83d08037da --- /dev/null +++ b/sc/qa/extras/sctabviewobj.cxx @@ -0,0 +1,92 @@ +/* -*- 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/calc_unoapi_test.hxx> +#include <test/sheet/xviewsplitable.hxx> + +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/frame/XModel.hpp> +#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> +#include <com/sun/star/sheet/XViewSplitable.hpp> +#include <com/sun/star/uno/XInterface.hpp> + +using namespace css; +using namespace css::uno; + +namespace sc_apitest { + +#define NUMBER_OF_TESTS 1 + +class ScTabViewObj : public CalcUnoApiTest, public apitest::XViewSplitable +{ +public: + ScTabViewObj(); + + virtual uno::Reference< uno::XInterface > init() override; + virtual void setUp() override; + virtual void tearDown() override; + + CPPUNIT_TEST_SUITE(ScTabViewObj); + // XViewSplitable + CPPUNIT_TEST(testSplit); + + CPPUNIT_TEST_SUITE_END(); + +private: + + static sal_Int32 nTest; + static uno::Reference< lang::XComponent > mxComponent; +}; + +sal_Int32 ScTabViewObj::nTest = 0; +uno::Reference< lang::XComponent > ScTabViewObj::mxComponent; + +ScTabViewObj::ScTabViewObj() + : CalcUnoApiTest("/sc/qa/extras/testdocuments") +{ +} + +uno::Reference< uno::XInterface > ScTabViewObj::init() +{ + if (!mxComponent.is()) + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("no calc document", xSheetDoc.is()); + + uno::Reference< frame::XModel > xModel(xSheetDoc, uno::UNO_QUERY_THROW); + uno::Reference< sheet::XViewSplitable > xViewSplitable(xModel->getCurrentController(), uno::UNO_QUERY_THROW); + + return xViewSplitable; +} + +void ScTabViewObj::setUp() +{ + nTest++; + CalcUnoApiTest::setUp(); +} + +void ScTabViewObj::tearDown() +{ + if (nTest == NUMBER_OF_TESTS) + { + closeDocument(mxComponent); + mxComponent.clear(); + } + + CalcUnoApiTest::tearDown(); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(ScTabViewObj); + +} // end namespace + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |