sc_ucalc: move formula tests to their own module

in order to split sc_ucalc monster into smaller
modules
Now, we can change CppunitTest_sc_ucalc.mk to
use the template

- Enable testExternalRefUnresolved on Linux/Mac
- Remove testFormulaHashAndTag. it was disabled in
f4dc8a869a
< the idea behind the test can't work right now >

Change-Id: I864341442ccd321c8ef4f7147db4512bcc7a6b21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115595
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli 2021-05-14 12:26:12 +02:00
parent 9bbf8057d9
commit c29f91f3d7
9 changed files with 536 additions and 699 deletions

View file

@ -1176,12 +1176,6 @@ sc/qa/unit/helper/qahelper.hxx:155
class std::__cxx11::basic_string<char, struct std::char_traits<char>, class std::allocator<char> > print(const class ScAddress &)
sc/qa/unit/screenshots/screenshots.cxx:325
int main()
sc/qa/unit/ucalc.hxx:151
void Test::testFormulaHashAndTag()
sc/qa/unit/ucalc.hxx:191
void Test::testSingleCellCopyColumnLabel()
sc/qa/unit/ucalc.hxx:251
void Test::testExternalRefUnresolved()
sc/source/core/inc/interpre.hxx:71
basic_ostream<type-parameter-?-?, type-parameter-?-?> & sc::operator<<(basic_ostream<type-parameter-?-?, type-parameter-?-?> &,const struct sc::ParamIfsResult &)
sc/source/core/opencl/formulagroupcl.cxx:1061

View file

@ -9,112 +9,7 @@
#
#*************************************************************************
$(eval $(call gb_CppunitTest_CppunitTest,sc_ucalc))
$(eval $(call gb_Library_use_common_precompiled_header,sc_ucalc))
$(eval $(call gb_CppunitTest_add_exception_objects,sc_ucalc, \
sc/qa/unit/ucalc \
sc/qa/unit/ucalc_formula \
))
$(eval $(call gb_CppunitTest_use_library_objects,sc_ucalc, \
sc \
scqahelper \
))
$(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
boost_headers \
$(call gb_Helper_optional,OPENCL, \
clew) \
icu_headers \
icui18n \
icuuc \
libxml2 \
mdds_headers \
orcus \
orcus-parser \
))
$(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
$(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
comphelper \
cppu \
cppuhelper \
dbtools \
drawinglayer \
editeng \
for \
forui \
i18nlangtag \
i18nutil \
$(call gb_Helper_optional,OPENCL, \
opencl) \
sal \
salhelper \
sax \
sb \
sfx \
sot \
svl \
svt \
svx \
svxcore \
test \
tk \
tl \
ucbhelper \
unotest \
utl \
vbahelper \
vcl \
xo \
))
$(eval $(call gb_CppunitTest_set_include,sc_ucalc,\
-I$(SRCDIR)/sc/source/ui/inc \
-I$(SRCDIR)/sc/source/core/inc \
-I$(SRCDIR)/sc/inc \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,sc_ucalc,\
udkapi \
offapi \
oovbaapi \
))
$(eval $(call gb_CppunitTest_use_custom_headers,sc_ucalc,\
officecfg/registry \
))
$(eval $(call gb_CppunitTest_use_ure,sc_ucalc))
$(eval $(call gb_CppunitTest_use_vcl,sc_ucalc))
$(eval $(call gb_CppunitTest_use_components,sc_ucalc,\
configmgr/source/configmgr \
framework/util/fwk \
i18npool/source/search/i18nsearch \
i18npool/util/i18npool \
sax/source/expatwrap/expwrap \
scaddins/source/analysis/analysis \
scaddins/source/datefunc/date \
scaddins/source/pricing/pricing \
sfx2/util/sfx \
ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \
unoxml/source/service/unoxml \
uui/util/uui \
vcl/vcl.common \
))
ifeq ($(OS),LINUX)
$(eval $(call gb_CppunitTest_add_libs,sc_ucalc,\
-lrt \
))
endif
$(eval $(call gb_CppunitTest_use_configuration,sc_ucalc))
# empty second argument (i.e. no 1)
$(eval $(call sc_ucalc_test,))
# vim: set noet sw=4 ts=4:

View file

@ -0,0 +1,14 @@
# -*- 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 sc_ucalc_test,_formula))
# vim: set noet sw=4 ts=4:

View file

@ -42,6 +42,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
CppunitTest_sc_ucalc) \
CppunitTest_sc_ucalc_condformat \
CppunitTest_sc_ucalc_copypaste \
CppunitTest_sc_ucalc_formula \
CppunitTest_sc_ucalc_pivottable \
CppunitTest_sc_ucalc_sharedformula \
CppunitTest_sc_ucalc_sort \

View file

@ -979,6 +979,13 @@ void pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDoc
rDestRange.aEnd.Col(), rDestRange.aEnd.Row());
}
void setCalcAsShown(ScDocument* pDoc, bool bCalcAsShown)
{
ScDocOptions aOpt = pDoc->GetDocOptions();
aOpt.SetCalcAsShown(bCalcAsShown);
pDoc->SetDocOptions(aOpt);
}
ScDocShell* findLoadedDocShellByName(std::u16string_view rName)
{
ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));

View file

@ -252,6 +252,7 @@ SCQAHELPER_DLLPUBLIC ScUndoPaste* createUndoPaste(ScDocShell& rDocSh, const ScRa
SCQAHELPER_DLLPUBLIC void pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange,
ScDocument* pClipDoc,
InsertDeleteFlags eFlags = InsertDeleteFlags::ALL);
SCQAHELPER_DLLPUBLIC void setCalcAsShown(ScDocument* pDoc, bool bCalcAsShown);
SCQAHELPER_DLLPUBLIC ScDocShell* findLoadedDocShellByName(std::u16string_view rName);
SCQAHELPER_DLLPUBLIC ScRange insertRangeData(ScDocument* pDoc, const ScAddress& rPos,
const std::vector<std::vector<const char*>>& rData);

View file

@ -5869,21 +5869,6 @@ void Test::testEmptyCalcDocDefaults()
CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasManualBreaks(tab) );
}
void Test::setExpandRefs(bool bExpand)
{
ScModule* pMod = SC_MOD();
ScInputOptions aOpt = pMod->GetInputOptions();
aOpt.SetExpandRefs(bExpand);
pMod->SetInputOptions(aOpt);
}
void Test::setCalcAsShown(ScDocument* pDoc, bool bCalcAsShown)
{
ScDocOptions aOpt = pDoc->GetDocOptions();
aOpt.SetCalcAsShown(bCalcAsShown);
pDoc->SetDocOptions(aOpt);
}
void Test::checkPrecisionAsShown( OUString& rCode, double fValue, double fExpectedRoundVal )
{
SvNumberFormatter* pFormatter = m_pDoc->GetFormatTable();

View file

@ -22,14 +22,6 @@ class ScUndoCut;
class Test : public test::BootstrapFixture
{
public:
/**
* Enable or disable expand reference options which controls how
* references in formula are expanded when inserting rows or columns.
*/
static void setExpandRefs(bool bExpand);
static void setCalcAsShown(ScDocument* pDoc, bool bCalcAsShown);
void checkPrecisionAsShown(OUString& rCode, double fValue, double fExpectedRoundVal);
Test();
@ -72,134 +64,12 @@ public:
void testMarkedCellIteration();
void testFormulaCreateStringFromTokens();
void testFormulaParseReference();
void testFetchVectorRefArray();
void testGroupConverter3D();
void testFormulaHashAndTag();
void testFormulaTokenEquality();
void testFormulaRefData();
void testFormulaCompiler();
void testFormulaCompilerJumpReordering();
void testFormulaCompilerImplicitIntersection2Param();
void testFormulaCompilerImplicitIntersection1ParamNoChange();
void testFormulaCompilerImplicitIntersection1ParamWithChange();
void testFormulaCompilerImplicitIntersection1NoGroup();
void testFormulaCompilerImplicitIntersectionOperators();
void testFormulaAnnotateTrimOnDoubleRefs();
void testFormulaRefUpdate();
void testFormulaRefUpdateRange();
void testFormulaRefUpdateSheets();
void testFormulaRefUpdateSheetsDelete();
void testFormulaRefUpdateInsertRows();
void testFormulaRefUpdateInsertColumns();
void testFormulaRefUpdateMove();
void testFormulaRefUpdateMoveUndo();
void testFormulaRefUpdateMoveUndo2();
void testFormulaRefUpdateMoveUndo3NonShared();
void testFormulaRefUpdateMoveUndo3Shared();
void testFormulaRefUpdateMoveUndoDependents();
void testFormulaRefUpdateMoveUndo4();
void testFormulaRefUpdateMoveToSheet();
void testFormulaRefUpdateDeleteContent();
void testFormulaRefUpdateDeleteAndShiftLeft();
void testFormulaRefUpdateDeleteAndShiftLeft2();
void testFormulaRefUpdateDeleteAndShiftUp();
void testFormulaRefUpdateName();
void testFormulaRefUpdateNameMove();
void testFormulaRefUpdateNameExpandRef();
void testFormulaRefUpdateNameExpandRef2();
void testFormulaRefUpdateNameDeleteRow();
void testFormulaRefUpdateNameCopySheet();
void testFormulaRefUpdateNameCopySheetCheckTab(SCTAB Tab, bool bCheckNames);
void testFormulaRefUpdateSheetLocalMove();
void testFormulaRefUpdateNameDelete();
void testFormulaRefUpdateValidity();
void testTokenArrayRefUpdateMove();
void testSingleCellCopyColumnLabel();
void testIntersectionOpExcel();
void testMultipleOperations();
void testFuncCOLUMN();
void testFuncCOUNT();
void testFuncCOUNTBLANK();
void testFuncROW();
void testFuncSUM();
void testFuncPRODUCT();
void testFuncSUMPRODUCT();
void testFuncSUMXMY2();
void testFuncMIN();
void testFuncN();
void testFuncCOUNTIF();
void testFuncNUMBERVALUE();
void testFuncLEN();
void testFuncLOOKUP();
void testFuncLOOKUParrayWithError();
void testTdf141146();
void testFuncVLOOKUP();
void testFuncMATCH();
void testFuncCELL();
void testFuncDATEDIF();
void testFuncINDIRECT();
void testFuncINDIRECT2();
void testFunc_MATCH_INDIRECT();
void testFuncIF();
void testFuncCHOOSE();
void testFuncIFERROR();
void testFuncSHEET();
void testFuncNOW();
void testMatrixOp();
void testFuncRangeOp();
void testFuncFORMULA();
void testFuncTableRef();
void testFuncFTEST();
void testFuncFTESTBug();
void testFuncCHITEST();
void testFuncTTEST();
void testFuncSUMX2PY2();
void testFuncSUMX2MY2();
void testFuncGCD();
void testFuncLCM();
void testFuncSUMSQ();
void testFuncMDETERM();
void testFuncSUMIFS();
void testFuncRefListArraySUBTOTAL();
void testFuncJumpMatrixArrayIF();
void testFuncJumpMatrixArrayOFFSET();
void testMatConcat();
void testMatConcatReplication();
void testRefR1C1WholeCol();
void testRefR1C1WholeRow();
void testIterations();
void testExternalRef();
void testExternalRefFunctions();
void testExternalRangeName();
void testExternalRefUnresolved();
void testCopyToDocument();
void testHorizontalIterator();
void testValueIterator();
void testHorizontalAttrIterator();
/**
* Basic test for formula dependency tracking.
*/
void testFormulaDepTracking();
/**
* Another test for formula dependency tracking, inspired by fdo#56278.
*/
void testFormulaDepTracking2();
void testFormulaDepTracking3();
void testFormulaDepTrackingDeleteRow();
void testFormulaDepTrackingDeleteCol();
void testFormulaMatrixResultUpdate();
/**
* More direct test for cell broadcaster management, used to track formula
* dependencies.
@ -294,23 +164,14 @@ public:
// tdf#80137
void testCopyPasteMatrixFormula();
void testUndoDataAnchor();
void testFormulaErrorPropagation();
void testSetFormula();
void testMultipleDataCellsInRange();
void testTdf97369();
void testTdf97587();
void testTdf93415();
void testTdf100818();
void testEmptyCalcDocDefaults();
void testPrecisionAsShown();
void testProtectedSheetEditByRow();
void testProtectedSheetEditByColumn();
void testFuncRowsHidden();
void testInsertColCellStoreEventSwap();
void testFormulaAfterDeleteRows();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
@ -328,117 +189,10 @@ public:
CPPUNIT_TEST(testDataEntries);
CPPUNIT_TEST(testSelectionFunction);
CPPUNIT_TEST(testMarkedCellIteration);
CPPUNIT_TEST(testFormulaCreateStringFromTokens);
CPPUNIT_TEST(testFormulaParseReference);
CPPUNIT_TEST(testFetchVectorRefArray);
CPPUNIT_TEST(testGroupConverter3D);
// CPPUNIT_TEST(testFormulaHashAndTag);
CPPUNIT_TEST(testFormulaTokenEquality);
CPPUNIT_TEST(testFormulaRefData);
CPPUNIT_TEST(testFormulaCompiler);
CPPUNIT_TEST(testFormulaCompilerJumpReordering);
CPPUNIT_TEST(testFormulaCompilerImplicitIntersection2Param);
CPPUNIT_TEST(testFormulaCompilerImplicitIntersection1ParamNoChange);
CPPUNIT_TEST(testFormulaCompilerImplicitIntersection1ParamWithChange);
CPPUNIT_TEST(testFormulaCompilerImplicitIntersection1NoGroup);
CPPUNIT_TEST(testFormulaCompilerImplicitIntersectionOperators);
CPPUNIT_TEST(testFormulaAnnotateTrimOnDoubleRefs);
CPPUNIT_TEST(testFormulaRefUpdate);
CPPUNIT_TEST(testFormulaRefUpdateRange);
CPPUNIT_TEST(testFormulaRefUpdateSheets);
CPPUNIT_TEST(testFormulaRefUpdateSheetsDelete);
CPPUNIT_TEST(testFormulaRefUpdateInsertRows);
CPPUNIT_TEST(testFormulaRefUpdateInsertColumns);
CPPUNIT_TEST(testFormulaRefUpdateMove);
CPPUNIT_TEST(testFormulaRefUpdateMoveUndo);
CPPUNIT_TEST(testFormulaRefUpdateMoveUndo2);
CPPUNIT_TEST(testFormulaRefUpdateMoveUndo3NonShared);
CPPUNIT_TEST(testFormulaRefUpdateMoveUndo3Shared);
CPPUNIT_TEST(testFormulaRefUpdateMoveUndoDependents);
CPPUNIT_TEST(testFormulaRefUpdateMoveUndo4);
CPPUNIT_TEST(testFormulaRefUpdateMoveToSheet);
CPPUNIT_TEST(testFormulaRefUpdateDeleteContent);
CPPUNIT_TEST(testFormulaRefUpdateDeleteAndShiftLeft);
CPPUNIT_TEST(testFormulaRefUpdateDeleteAndShiftLeft2);
CPPUNIT_TEST(testFormulaRefUpdateDeleteAndShiftUp);
CPPUNIT_TEST(testFormulaRefUpdateName);
CPPUNIT_TEST(testFormulaRefUpdateNameMove);
CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef);
CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef2);
CPPUNIT_TEST(testFormulaRefUpdateNameDeleteRow);
CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
CPPUNIT_TEST(testFormulaRefUpdateSheetLocalMove);
CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
CPPUNIT_TEST(testFormulaRefUpdateValidity);
CPPUNIT_TEST(testTokenArrayRefUpdateMove);
CPPUNIT_TEST(testIntersectionOpExcel);
CPPUNIT_TEST(testMultipleOperations);
CPPUNIT_TEST(testFuncCOLUMN);
CPPUNIT_TEST(testFuncCOUNT);
CPPUNIT_TEST(testFuncCOUNTBLANK);
CPPUNIT_TEST(testFuncROW);
CPPUNIT_TEST(testFuncSUM);
CPPUNIT_TEST(testFuncPRODUCT);
CPPUNIT_TEST(testFuncSUMPRODUCT);
CPPUNIT_TEST(testFuncSUMXMY2);
CPPUNIT_TEST(testFuncMIN);
CPPUNIT_TEST(testFuncN);
CPPUNIT_TEST(testFuncCOUNTIF);
CPPUNIT_TEST(testFuncNUMBERVALUE);
CPPUNIT_TEST(testFuncLEN);
CPPUNIT_TEST(testFuncLOOKUP);
CPPUNIT_TEST(testFuncLOOKUParrayWithError);
CPPUNIT_TEST(testTdf141146);
CPPUNIT_TEST(testFuncVLOOKUP);
CPPUNIT_TEST(testFuncMATCH);
CPPUNIT_TEST(testFuncCELL);
CPPUNIT_TEST(testFuncDATEDIF);
CPPUNIT_TEST(testFuncINDIRECT);
CPPUNIT_TEST(testFuncINDIRECT2);
CPPUNIT_TEST(testFunc_MATCH_INDIRECT);
CPPUNIT_TEST(testFuncIF);
CPPUNIT_TEST(testFuncCHOOSE);
CPPUNIT_TEST(testFuncIFERROR);
CPPUNIT_TEST(testRefR1C1WholeCol);
CPPUNIT_TEST(testRefR1C1WholeRow);
CPPUNIT_TEST(testIterations);
CPPUNIT_TEST(testMatrixOp);
CPPUNIT_TEST(testFuncRangeOp);
CPPUNIT_TEST(testFuncFORMULA);
CPPUNIT_TEST(testFuncTableRef);
CPPUNIT_TEST(testFuncFTEST);
CPPUNIT_TEST(testFuncFTESTBug);
CPPUNIT_TEST(testFuncCHITEST);
CPPUNIT_TEST(testFuncTTEST);
CPPUNIT_TEST(testFuncSUMX2PY2);
CPPUNIT_TEST(testFuncSUMX2MY2);
CPPUNIT_TEST(testFuncGCD);
CPPUNIT_TEST(testFuncLCM);
CPPUNIT_TEST(testFuncSUMSQ);
CPPUNIT_TEST(testFuncMDETERM);
CPPUNIT_TEST(testFuncSUMIFS);
CPPUNIT_TEST(testFuncRefListArraySUBTOTAL);
CPPUNIT_TEST(testFuncJumpMatrixArrayIF);
CPPUNIT_TEST(testFuncJumpMatrixArrayOFFSET);
CPPUNIT_TEST(testMatConcat);
CPPUNIT_TEST(testMatConcatReplication);
CPPUNIT_TEST(testExternalRef);
CPPUNIT_TEST(testExternalRangeName);
CPPUNIT_TEST(testExternalRefFunctions);
// currently crashes windows
// CPPUNIT_TEST(testExternalRefUnresolved);
CPPUNIT_TEST(testCopyToDocument);
CPPUNIT_TEST(testFuncSHEET);
CPPUNIT_TEST(testFuncNOW);
CPPUNIT_TEST(testHorizontalIterator);
CPPUNIT_TEST(testValueIterator);
CPPUNIT_TEST(testHorizontalAttrIterator);
CPPUNIT_TEST(testFormulaDepTracking);
CPPUNIT_TEST(testFormulaDepTracking2);
CPPUNIT_TEST(testFormulaDepTracking3);
CPPUNIT_TEST(testFormulaDepTrackingDeleteRow);
CPPUNIT_TEST(testFormulaDepTrackingDeleteCol);
CPPUNIT_TEST(testFormulaMatrixResultUpdate);
CPPUNIT_TEST(testCellBroadcaster);
CPPUNIT_TEST(testFuncParam);
CPPUNIT_TEST(testNamedRange);
@ -496,20 +250,12 @@ public:
CPPUNIT_TEST(testSetStringAndNote);
CPPUNIT_TEST(testCopyPasteMatrixFormula);
CPPUNIT_TEST(testUndoDataAnchor);
CPPUNIT_TEST(testFormulaErrorPropagation);
CPPUNIT_TEST(testSetFormula);
CPPUNIT_TEST(testMultipleDataCellsInRange);
CPPUNIT_TEST(testTdf97369);
CPPUNIT_TEST(testTdf97587);
CPPUNIT_TEST(testTdf93415);
CPPUNIT_TEST(testTdf100818);
CPPUNIT_TEST(testEmptyCalcDocDefaults);
CPPUNIT_TEST(testPrecisionAsShown);
CPPUNIT_TEST(testProtectedSheetEditByRow);
CPPUNIT_TEST(testProtectedSheetEditByColumn);
CPPUNIT_TEST(testFuncRowsHidden);
CPPUNIT_TEST(testInsertColCellStoreEventSwap);
CPPUNIT_TEST(testFormulaAfterDeleteRows);
CPPUNIT_TEST_SUITE_END();
private:

File diff suppressed because it is too large Load diff