Kaydet (Commit) 21edfcb8 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

test case for ScRangeList

Change-Id: I371ac1b3236777a73e4f25f93d465041308e34b4
üst 4cf0759e
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License or as specified alternatively below. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Major Contributor(s):
# Copyright (C) 2011 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
# (initial developer)
#
# All Rights Reserved.
#
# For minor contributions see the git repository.
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
# instead of those above.
$(eval $(call gb_CppunitTest_CppunitTest,sc_rangelst_test))
$(eval $(call gb_CppunitTest_add_exception_objects,sc_rangelst_test, \
sc/qa/unit/rangelst_test \
))
$(eval $(call gb_CppunitTest_use_libraries,sc_rangelst_test, \
avmedia \
basegfx \
comphelper \
cppu \
cppuhelper \
drawinglayer \
editeng \
fileacc \
for \
forui \
i18nisolang1 \
msfilter \
oox \
sal \
salhelper \
sax \
sb \
sc \
sfx \
sot \
svl \
svt \
svx \
svxcore \
test \
tl \
tk \
ucbhelper \
unotest \
utl \
vbahelper \
vcl \
xo \
$(gb_STDLIBS) \
))
$(eval $(call gb_CppunitTest_set_include,sc_rangelst_test,\
-I$(SRCDIR)/sc/source/ui/inc \
-I$(SRCDIR)/sc/inc \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,sc_rangelst_test,\
offapi \
oovbaapi \
udkapi \
))
$(eval $(call gb_CppunitTest_use_ure,sc_rangelst_test))
$(eval $(call gb_CppunitTest_use_components,sc_rangelst_test,\
basic/util/sb \
chart2/source/controller/chartcontroller \
chart2/source/chartcore \
comphelper/util/comphelp \
configmgr/source/configmgr \
dbaccess/util/dba \
embeddedobj/util/embobj \
eventattacher/source/evtatt \
fileaccess/source/fileacc \
filter/source/config/cache/filterconfig1 \
forms/util/frm \
framework/util/fwk \
i18npool/util/i18npool \
oox/util/oox \
package/source/xstor/xstor \
package/util/package2 \
sax/source/expatwrap/expwrap \
sax/source/fastparser/fastsax \
sc/util/sc \
sc/util/scd \
sc/util/scfilt \
sc/util/vbaobj \
scaddins/source/analysis/analysis \
scaddins/source/datefunc/date \
scripting/source/basprov/basprov \
scripting/util/scriptframe \
sfx2/util/sfx \
sot/util/sot \
svl/source/fsstor/fsstorage \
svl/util/svl \
svx/util/svx \
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 \
xmloff/util/xo \
))
$(eval $(call gb_CppunitTest_use_configuration,sc_rangelst_test))
$(eval $(call gb_CppunitTest_use_filter_configuration,sc_rangelst_test))
$(eval $(call gb_CppunitTest_use_unittest_configuration,sc_rangelst_test))
# vim: set noet sw=4 ts=4:
......@@ -44,6 +44,7 @@ endif
$(eval $(call gb_Module_add_check_targets,sc,\
CppunitTest_sc_ucalc \
CppunitTest_sc_filters_test \
CppunitTest_sc_rangelst_test \
))
$(eval $(call gb_Module_add_slowcheck_targets,sc,\
......
......@@ -36,6 +36,8 @@ class SfxFilter;
#include <sfx2/module.hxx>
#include <sfx2/docfac.hxx>
#include "scdllapi.h"
/**
* This class is a wrapper for a Load-On-Demand-DLL. One instance per
* SfxApplication will be created for the runtime of
......@@ -56,7 +58,7 @@ public:
static void PreExit(); // muss vor LibExit gerufen werden
// DLL-init/exit-code must be linked to the DLL only
static void Init(); // called directly after loading the DLL
static SC_DLLPUBLIC void Init(); // called directly after loading the DLL
static sal_uLong DetectFilter( SfxMedium& rMedium, const SfxFilter** ppFilter,
SfxFilterFlags nMust, SfxFilterFlags nDont );
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 <sal/config.h>
#include <test/bootstrapfixture.hxx>
#include "document.hxx"
#include "docsh.hxx"
#include "rangelst.hxx"
class Test : public test::BootstrapFixture {
public:
virtual void setUp();
virtual void tearDown();
void testDeleteArea_4Ranges();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testDeleteArea_4Ranges);
CPPUNIT_TEST_SUITE_END();
private:
ScDocument *m_pDoc;
ScDocShellRef m_xDocShRef;
};
void Test::setUp()
{
BootstrapFixture::setUp();
ScDLL::Init();
m_xDocShRef = new ScDocShell(
SFXMODEL_STANDARD |
SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
m_pDoc = m_xDocShRef->GetDocument();
}
void Test::tearDown()
{
m_xDocShRef.Clear();
BootstrapFixture::tearDown();
}
void Test::testDeleteArea_4Ranges()
{
ScRangeList aList(ScRange(0,0,0,5,5,0));
aList.DeleteArea(2,2,0,3,3,0);
CPPUNIT_ASSERT_EQUAL(aList.size(), static_cast<size_t>(4));
for(SCCOL nCol = 0; nCol <= 5; ++nCol)
{
for(SCROW nRow = 0; nRow <= 5; ++nRow)
{
if((nCol == 2 || nCol == 3) && ( nRow == 2 || nRow == 3))
CPPUNIT_ASSERT(!aList.Intersects(ScRange(nCol, nRow, 0)));
else
CPPUNIT_ASSERT(aList.Intersects(ScRange(nCol, nRow, 0)));
}
}
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment