sc/qa/unit/ucalc.cxx | 473 ++++++++----------------------- sc/qa/unit/ucalc_condformat.cxx | 157 ++-------- sc/qa/unit/ucalc_copypaste.cxx | 411 ++++++--------------------- sc/qa/unit/ucalc_datatransformation.cxx | 175 ++--------- sc/qa/unit/ucalc_formula.cxx | 483 +++++++------------------------- sc/qa/unit/ucalc_parallelism.cxx | 78 +---- sc/qa/unit/ucalc_pivottable.cxx | 209 ++++--------- sc/qa/unit/ucalc_range.cxx | 50 --- sc/qa/unit/ucalc_rangelst.cxx | 116 +------ sc/qa/unit/ucalc_sharedformula.cxx | 116 +------ sc/qa/unit/ucalc_sort.cxx | 91 +----- sc/qa/unit/ucalc_sparkline.cxx | 58 --- 12 files changed, 618 insertions(+), 1799 deletions(-)
New commits: commit 818e98eed2ecf76b5ddcd17667d80fa935b7a91a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Feb 23 21:08:54 2023 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Feb 24 09:24:02 2023 +0000 CppunitTest_sc_ucalc*: use CPPUNIT_TEST_FIXTURE() These suites are large enough so that avoiding the declaration/registration/definition of each test manually saves a lot of space. Change-Id: Ib24643438ecf52da1ba700522435f70e7ba2aa95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147590 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 8b78c55ae005..e3f257825e97 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -81,261 +81,12 @@ struct HoriIterCheck class Test : public ScUcalcTestBase { -public: +protected: void checkPrecisionAsShown(OUString& rCode, double fValue, double fExpectedRoundVal); /** Get a separate new ScDocShell with ScDocument that suits unit test needs. */ void getNewDocShell(ScDocShellRef& rDocShellRef); - void testCollator(); - void testSharedStringPool(); - void testSharedStringPoolUndoDoc(); - void testRangeList(); - void testMarkData(); - void testInput(); - void testColumnIterator(); - void testTdf90698(); - void testTdf114406(); - void testTdf93951(); - void testTdf134490(); - void testTdf135249(); - void testDocStatistics(); - void testRowForHeight(); - - /** - * The 'data entries' data is a list of strings used for suggestions as - * the user types in new cell value. - */ - void testDataEntries(); - - /** - * Selection function is responsible for displaying quick calculation - * results in the status bar. - */ - void testSelectionFunction(); - - void testMarkedCellIteration(); - - void testCopyToDocument(); - - void testHorizontalIterator(); - void testValueIterator(); - void testHorizontalAttrIterator(); - void testIteratorsUnallocatedColumnsAttributes(); - void testIteratorsDefPattern(); - void testLastChangedColFlagsWidth(); - - /** - * More direct test for cell broadcaster management, used to track formula - * dependencies. - */ - void testCellBroadcaster(); - - void testFuncParam(); - void testNamedRange(); - void testInsertNameList(); - void testCSV(); - void testMatrix(); - void testMatrixComparisonWithErrors(); - void testMatrixConditionalBooleanResult(); - void testEnterMixedMatrix(); - void testMatrixEditable(); - - void testCellCopy(); - void testSheetCopy(); - void testSheetMove(); - void testDataArea(); - void testAutofilter(); - void testAutoFilterTimeValue(); - void testAutofilterOptimizations(); - void testTdf76836(); - void testTdf76441(); - void testTdf142186(); - void testTdf137063(); - void testTdf126342(); - void testAdvancedFilter(); - void testDateFilterContains(); - void testTdf98642(); - void testMergedCells(); - void testUpdateReference(); - void testSearchCells(); - void testFormulaPosition(); - void testFormulaWizardSubformula(); - void testDiagonalBorders(); - void testWholeDocBorders(); - - /** - * Make sure the sheet streams are invalidated properly. - */ - void testStreamValid(); - - /** - * Test built-in cell functions to make sure their categories and order - * are correct. - */ - void testFunctionLists(); - - void testGraphicsInGroup(); - void testGraphicsOnSheetMove(); - - /** - * Test toggling relative/absolute flag of cell and cell range references. - * This corresponds with hitting Shift-F4 while the cursor is on a formula - * cell. - */ - void testToggleRefFlag(); - - /** - * Test to make sure correct precedent / dependent cells are obtained when - * preparing to jump to them. - */ - void testJumpToPrecedentsDependents(); - - void testSetBackgroundColor(); - void testRenameTable(); - - void testTdf149665(); - void testTdf64001(); - void testAutoFill(); - void testAutoFillSimple(); - - void testFindAreaPosVertical(); - void testFindAreaPosColRight(); - void testShiftCells(); - - void testNoteBasic(); - void testNoteDeleteRow(); - void testNoteDeleteCol(); - void testNoteLifeCycle(); - void testNoteCopyPaste(); - void testNoteContainsNotesInRange(); - void testAreasWithNotes(); - void testAnchoredRotatedShape(); - void testCellTextWidth(); - void testEditTextIterator(); - - void testImportStream(); - void testDeleteContents(); - void testTransliterateText(); - - void testFormulaToValue(); - void testFormulaToValue2(); - - void testColumnFindEditCells(); - void testSetStringAndNote(); - - void testUndoDataAnchor(); - void testSetFormula(); - void testMultipleDataCellsInRange(); - - void testEmptyCalcDocDefaults(); - - void testPrecisionAsShown(); - void testProtectedSheetEditByRow(); - void testProtectedSheetEditByColumn(); - - void testInsertColumnsWithFormulaCells(); - - CPPUNIT_TEST_SUITE(Test); - CPPUNIT_TEST(testCollator); - CPPUNIT_TEST(testSharedStringPool); - CPPUNIT_TEST(testSharedStringPoolUndoDoc); - CPPUNIT_TEST(testRangeList); - CPPUNIT_TEST(testMarkData); - CPPUNIT_TEST(testInput); - CPPUNIT_TEST(testColumnIterator); - CPPUNIT_TEST(testTdf90698); - CPPUNIT_TEST(testTdf114406); - CPPUNIT_TEST(testTdf93951); - CPPUNIT_TEST(testTdf134490); - CPPUNIT_TEST(testTdf135249); - CPPUNIT_TEST(testDocStatistics); - CPPUNIT_TEST(testRowForHeight); - CPPUNIT_TEST(testDataEntries); - CPPUNIT_TEST(testSelectionFunction); - CPPUNIT_TEST(testMarkedCellIteration); - CPPUNIT_TEST(testCopyToDocument); - CPPUNIT_TEST(testHorizontalIterator); - CPPUNIT_TEST(testValueIterator); - CPPUNIT_TEST(testHorizontalAttrIterator); - CPPUNIT_TEST(testIteratorsUnallocatedColumnsAttributes); - CPPUNIT_TEST(testIteratorsDefPattern); - CPPUNIT_TEST(testLastChangedColFlagsWidth); - CPPUNIT_TEST(testCellBroadcaster); - CPPUNIT_TEST(testFuncParam); - CPPUNIT_TEST(testNamedRange); - CPPUNIT_TEST(testInsertNameList); - CPPUNIT_TEST(testCSV); - CPPUNIT_TEST(testMatrix); - CPPUNIT_TEST(testMatrixComparisonWithErrors); - CPPUNIT_TEST(testMatrixConditionalBooleanResult); - CPPUNIT_TEST(testEnterMixedMatrix); - CPPUNIT_TEST(testMatrixEditable); - CPPUNIT_TEST(testCellCopy); - CPPUNIT_TEST(testSheetCopy); - CPPUNIT_TEST(testSheetMove); - CPPUNIT_TEST(testDataArea); - CPPUNIT_TEST(testGraphicsInGroup); - CPPUNIT_TEST(testGraphicsOnSheetMove); - CPPUNIT_TEST(testStreamValid); - CPPUNIT_TEST(testFunctionLists); - CPPUNIT_TEST(testToggleRefFlag); - CPPUNIT_TEST(testAutofilter); - CPPUNIT_TEST(testAutoFilterTimeValue); - CPPUNIT_TEST(testAutofilterOptimizations); - CPPUNIT_TEST(testTdf76836); - CPPUNIT_TEST(testTdf76441); - CPPUNIT_TEST(testTdf142186); - CPPUNIT_TEST(testTdf137063); - CPPUNIT_TEST(testTdf126342); - CPPUNIT_TEST(testAdvancedFilter); - CPPUNIT_TEST(testDateFilterContains); - CPPUNIT_TEST(testTdf98642); - CPPUNIT_TEST(testMergedCells); - CPPUNIT_TEST(testUpdateReference); - CPPUNIT_TEST(testSearchCells); - CPPUNIT_TEST(testFormulaPosition); - CPPUNIT_TEST(testFormulaWizardSubformula); - CPPUNIT_TEST(testDiagonalBorders); - CPPUNIT_TEST(testWholeDocBorders); - CPPUNIT_TEST(testJumpToPrecedentsDependents); - CPPUNIT_TEST(testSetBackgroundColor); - CPPUNIT_TEST(testRenameTable); - CPPUNIT_TEST(testTdf149665); - CPPUNIT_TEST(testTdf64001); - CPPUNIT_TEST(testAutoFill); - CPPUNIT_TEST(testAutoFillSimple); - CPPUNIT_TEST(testFindAreaPosVertical); - CPPUNIT_TEST(testFindAreaPosColRight); - CPPUNIT_TEST(testShiftCells); - CPPUNIT_TEST(testNoteBasic); - CPPUNIT_TEST(testNoteDeleteRow); - CPPUNIT_TEST(testNoteDeleteCol); - CPPUNIT_TEST(testNoteLifeCycle); - CPPUNIT_TEST(testNoteCopyPaste); - CPPUNIT_TEST(testNoteContainsNotesInRange); - CPPUNIT_TEST(testAreasWithNotes); - CPPUNIT_TEST(testAnchoredRotatedShape); - CPPUNIT_TEST(testCellTextWidth); - CPPUNIT_TEST(testEditTextIterator); - CPPUNIT_TEST(testImportStream); - CPPUNIT_TEST(testDeleteContents); - CPPUNIT_TEST(testTransliterateText); - CPPUNIT_TEST(testFormulaToValue); - CPPUNIT_TEST(testFormulaToValue2); - CPPUNIT_TEST(testColumnFindEditCells); - CPPUNIT_TEST(testSetStringAndNote); - CPPUNIT_TEST(testUndoDataAnchor); - CPPUNIT_TEST(testSetFormula); - CPPUNIT_TEST(testMultipleDataCellsInRange); - CPPUNIT_TEST(testEmptyCalcDocDefaults); - CPPUNIT_TEST(testPrecisionAsShown); - CPPUNIT_TEST(testProtectedSheetEditByRow); - CPPUNIT_TEST(testProtectedSheetEditByColumn); - CPPUNIT_TEST(testInsertColumnsWithFormulaCells); - CPPUNIT_TEST_SUITE_END(); - -private: bool checkHorizontalIterator(ScDocument& rDoc, const std::vector<std::vector<const char*>>& rData, const HoriIterCheck* pChecks, size_t nCheckCount); }; @@ -350,13 +101,13 @@ void Test::getNewDocShell( ScDocShellRef& rDocShellRef ) rDocShellRef->DoInitUnitTest(); } -void Test::testCollator() +CPPUNIT_TEST_FIXTURE(Test, testCollator) { sal_Int32 nRes = ScGlobal::GetCollator().compareString("A", "B"); CPPUNIT_ASSERT_MESSAGE("these strings are supposed to be different!", nRes != 0); } -void Test::testSharedStringPool() +CPPUNIT_TEST_FIXTURE(Test, testSharedStringPool) { m_pDoc->InsertTab(0, "foo"); @@ -472,7 +223,7 @@ void Test::testSharedStringPool() m_pDoc->DeleteTab(0); } -void Test::testSharedStringPoolUndoDoc() +CPPUNIT_TEST_FIXTURE(Test, testSharedStringPoolUndoDoc) { struct { @@ -527,7 +278,7 @@ void Test::testSharedStringPoolUndoDoc() m_pDoc->DeleteTab(0); } -void Test::testRangeList() +CPPUNIT_TEST_FIXTURE(Test, testRangeList) { m_pDoc->InsertTab(0, "foo"); @@ -544,7 +295,7 @@ void Test::testRangeList() m_pDoc->DeleteTab(0); } -void Test::testMarkData() +CPPUNIT_TEST_FIXTURE(Test, testMarkData) { ScMarkData aMarkData(m_pDoc->GetSheetLimits()); @@ -593,7 +344,7 @@ void Test::testMarkData() CPPUNIT_ASSERT_EQUAL(static_cast<SCCOLROW>(5), aSpans[0].mnEnd); } -void Test::testInput() +CPPUNIT_TEST_FIXTURE(Test, testInput) { CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", @@ -619,7 +370,7 @@ void Test::testInput() m_pDoc->DeleteTab(0); } -void Test::testColumnIterator() // tdf#118620 +CPPUNIT_TEST_FIXTURE(Test, testColumnIterator) // tdf#118620 { CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "foo")); @@ -636,7 +387,7 @@ void Test::testColumnIterator() // tdf#118620 m_pDoc->DeleteTab(0); } -void Test::testTdf90698() +CPPUNIT_TEST_FIXTURE(Test, testTdf90698) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); m_pDoc->SetString(ScAddress(0,0,0), "=(1;2)"); @@ -650,7 +401,7 @@ void Test::testTdf90698() m_pDoc->DeleteTab(0); } -void Test::testTdf114406() +CPPUNIT_TEST_FIXTURE(Test, testTdf114406) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); m_pDoc->SetString(ScAddress(0,0,0), "5"); @@ -667,7 +418,7 @@ void Test::testTdf114406() m_pDoc->DeleteTab(0); } -void Test::testTdf93951() +CPPUNIT_TEST_FIXTURE(Test, testTdf93951) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); m_pDoc->SetString(ScAddress(0,0,0), u"=2*ยง*2"); @@ -682,7 +433,7 @@ void Test::testTdf93951() m_pDoc->DeleteTab(0); } -void Test::testTdf134490() +CPPUNIT_TEST_FIXTURE(Test, testTdf134490) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); @@ -702,7 +453,7 @@ void Test::testTdf134490() m_pDoc->DeleteTab(0); } -void Test::testTdf135249() +CPPUNIT_TEST_FIXTURE(Test, testTdf135249) { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); @@ -729,7 +480,7 @@ void Test::testTdf135249() m_pDoc->DeleteTab(0); } -void Test::testDocStatistics() +CPPUNIT_TEST_FIXTURE(Test, testDocStatistics) { SCTAB nStartTabs = m_pDoc->GetTableCount(); m_pDoc->InsertTab(0, "Sheet1"); @@ -765,7 +516,7 @@ void Test::testDocStatistics() m_pDoc->DeleteTab(0); // This may fail in case there is only one sheet in the document. } -void Test::testRowForHeight() +CPPUNIT_TEST_FIXTURE(Test, testRowForHeight) { m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->SetRowHeightRange( 0, 9, 0, 100); @@ -800,8 +551,12 @@ void Test::testRowForHeight() } } -void Test::testDataEntries() +CPPUNIT_TEST_FIXTURE(Test, testDataEntries) { + /** + * The 'data entries' data is a list of strings used for suggestions as + * the user types in new cell value. + */ m_pDoc->InsertTab(0, "Test"); m_pDoc->SetString(ScAddress(0,5,0), "Andy"); @@ -840,8 +595,12 @@ void Test::testDataEntries() m_pDoc->DeleteTab(0); } -void Test::testSelectionFunction() +CPPUNIT_TEST_FIXTURE(Test, testSelectionFunction) { + /** + * Selection function is responsible for displaying quick calculation + * results in the status bar. + */ m_pDoc->InsertTab(0, "Test"); // Insert values into B2:B4. @@ -1009,7 +768,7 @@ void Test::testSelectionFunction() m_pDoc->DeleteTab(0); } -void Test::testMarkedCellIteration() +CPPUNIT_TEST_FIXTURE(Test, testMarkedCellIteration) { m_pDoc->InsertTab(0, "Test"); @@ -1061,7 +820,7 @@ void Test::testMarkedCellIteration() m_pDoc->DeleteTab(0); } -void Test::testCopyToDocument() +CPPUNIT_TEST_FIXTURE(Test, testCopyToDocument) { CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "src")); @@ -1151,7 +910,7 @@ bool Test::checkHorizontalIterator(ScDocument& rDoc, const std::vector<std::vect return true; } -void Test::testHorizontalIterator() +CPPUNIT_TEST_FIXTURE(Test, testHorizontalIterator) { m_pDoc->InsertTab(0, "test"); @@ -1297,7 +1056,7 @@ void Test::testHorizontalIterator() m_pDoc->DeleteTab(0); } -void Test::testValueIterator() +CPPUNIT_TEST_FIXTURE(Test, testValueIterator) { m_pDoc->InsertTab(0, "Test"); @@ -1331,7 +1090,7 @@ void Test::testValueIterator() m_pDoc->DeleteTab(0); } -void Test::testHorizontalAttrIterator() +CPPUNIT_TEST_FIXTURE(Test, testHorizontalAttrIterator) { m_pDoc->InsertTab(0, "Test"); @@ -1372,7 +1131,7 @@ void Test::testHorizontalAttrIterator() m_pDoc->DeleteTab(0); } -void Test::testIteratorsUnallocatedColumnsAttributes() +CPPUNIT_TEST_FIXTURE(Test, testIteratorsUnallocatedColumnsAttributes) { m_pDoc->InsertTab(0, "Tab1"); @@ -1431,7 +1190,7 @@ void Test::testIteratorsUnallocatedColumnsAttributes() m_pDoc->DeleteTab(0); } -void Test::testIteratorsDefPattern() +CPPUNIT_TEST_FIXTURE(Test, testIteratorsDefPattern) { m_pDoc->InsertTab(0, "Tab1"); @@ -1482,7 +1241,7 @@ void Test::testIteratorsDefPattern() m_pDoc->DeleteTab(0); } -void Test::testLastChangedColFlagsWidth() +CPPUNIT_TEST_FIXTURE(Test, testLastChangedColFlagsWidth) { m_pDoc->InsertTab(0, "Tab1"); @@ -1586,8 +1345,12 @@ bool checkDeletedRefToken(ScDocument& rDoc, const ScAddress& rPos) } -void Test::testCellBroadcaster() +CPPUNIT_TEST_FIXTURE(Test, testCellBroadcaster) { + /** + * More direct test for cell broadcaster management, used to track formula + * dependencies. + */ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "foo")); sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation. @@ -1779,7 +1542,7 @@ void Test::testCellBroadcaster() m_pDoc->DeleteTab(0); } -void Test::testFuncParam() +CPPUNIT_TEST_FIXTURE(Test, testFuncParam) { CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", @@ -1907,7 +1670,7 @@ void Test::testFuncParam() m_pDoc->DeleteTab(0); } -void Test::testNamedRange() +CPPUNIT_TEST_FIXTURE(Test, testNamedRange) { static const RangeNameDef aNames[] = { { "Divisor", "$Sheet1.$A$1:$A$1048576", 1 }, @@ -1985,7 +1748,7 @@ void Test::testNamedRange() m_pDoc->DeleteTab(0); } -void Test::testInsertNameList() +CPPUNIT_TEST_FIXTURE(Test, testInsertNameList) { m_pDoc->InsertTab(0, "Test"); @@ -2018,7 +1781,7 @@ void Test::testInsertNameList() m_pDoc->DeleteTab(0); } -void Test::testCSV() +CPPUNIT_TEST_FIXTURE(Test, testCSV) { const int English = 0, European = 1; struct { @@ -2139,7 +1902,7 @@ struct PartiallyFilledEmptyMatrix } -void Test::testMatrix() +CPPUNIT_TEST_FIXTURE(Test, testMatrix) { svl::SharedStringPool& rPool = m_pDoc->GetSharedStringPool(); ScMatrixRef pMat, pMat2; @@ -2275,7 +2038,7 @@ void Test::testMatrix() } } -void Test::testMatrixComparisonWithErrors() +CPPUNIT_TEST_FIXTURE(Test, testMatrixComparisonWithErrors) { m_pDoc->InsertTab(0, "foo"); @@ -2297,7 +2060,7 @@ void Test::testMatrixComparisonWithErrors() m_pDoc->DeleteTab(0); } -void Test::testMatrixConditionalBooleanResult() +CPPUNIT_TEST_FIXTURE(Test, testMatrixConditionalBooleanResult) { m_pDoc->InsertTab(0, "foo"); @@ -2322,7 +2085,7 @@ void Test::testMatrixConditionalBooleanResult() m_pDoc->DeleteTab(0); } -void Test::testEnterMixedMatrix() +CPPUNIT_TEST_FIXTURE(Test, testEnterMixedMatrix) { m_pDoc->InsertTab(0, "foo"); @@ -2347,7 +2110,7 @@ void Test::testEnterMixedMatrix() m_pDoc->DeleteTab(0); } -void Test::testMatrixEditable() +CPPUNIT_TEST_FIXTURE(Test, testMatrixEditable) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on. @@ -2390,7 +2153,7 @@ void Test::testMatrixEditable() m_pDoc->DeleteTab(0); } -void Test::testCellCopy() +CPPUNIT_TEST_FIXTURE(Test, testCellCopy) { m_pDoc->InsertTab(0, "TestTab"); ScAddress aSrc(0,0,0); @@ -2403,7 +2166,7 @@ void Test::testCellCopy() CPPUNIT_ASSERT_EQUAL(aStr, m_pDoc->GetString(aDest)); } -void Test::testSheetCopy() +CPPUNIT_TEST_FIXTURE(Test, testSheetCopy) { m_pDoc->InsertTab(0, "TestTab"); CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have one sheet to begin with.", @@ -2494,7 +2257,7 @@ void Test::testSheetCopy() m_pDoc->DeleteTab(0); } -void Test::testSheetMove() +CPPUNIT_TEST_FIXTURE(Test, testSheetMove) { m_pDoc->InsertTab(0, "TestTab1"); CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have one sheet to begin with.", static_cast<SCTAB>(1), m_pDoc->GetTableCount()); @@ -2558,7 +2321,7 @@ void Test::testSheetMove() m_pDoc->DeleteTab(0); } -void Test::testDataArea() +CPPUNIT_TEST_FIXTURE(Test, testDataArea) { m_pDoc->InsertTab(0, "Data"); @@ -2592,8 +2355,11 @@ void Test::testDataArea() m_pDoc->DeleteTab(0); } -void Test::testStreamValid() +CPPUNIT_TEST_FIXTURE(Test, testStreamValid) { + /** + * Make sure the sheet streams are invalidated properly. + */ m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->InsertTab(1, "Sheet2"); m_pDoc->InsertTab(2, "Sheet3"); @@ -2665,8 +2431,12 @@ void Test::testStreamValid() m_pDoc->DeleteTab(0); } -void Test::testFunctionLists() +CPPUNIT_TEST_FIXTURE(Test, testFunctionLists) { + /** + * Test built-in cell functions to make sure their categories and order + * are correct. + */ const char* aDataBase[] = { "DAVERAGE", "DCOUNT", @@ -3146,7 +2916,7 @@ void Test::testFunctionLists() } } -void Test::testGraphicsInGroup() +CPPUNIT_TEST_FIXTURE(Test, testGraphicsInGroup) { m_pDoc->InsertTab(0, "TestTab"); CPPUNIT_ASSERT_EQUAL_MESSAGE("document should have one sheet to begin with.", @@ -3266,7 +3036,7 @@ void Test::testGraphicsInGroup() m_pDoc->DeleteTab(0); } -void Test::testGraphicsOnSheetMove() +CPPUNIT_TEST_FIXTURE(Test, testGraphicsOnSheetMove) { m_pDoc->InsertTab(0, "Tab1"); m_pDoc->InsertTab(1, "Tab2"); @@ -3352,8 +3122,13 @@ void Test::testGraphicsOnSheetMove() m_pDoc->DeleteTab(0); } -void Test::testToggleRefFlag() +CPPUNIT_TEST_FIXTURE(Test, testToggleRefFlag) { + /** + * Test toggling relative/absolute flag of cell and cell range references. + * This corresponds with hitting Shift-F4 while the cursor is on a formula + * cell. + */ // In this test, there is no need to insert formula string into a cell in // the document, as ScRefFinder does not depend on the content of the // document except for the sheet names. @@ -3490,7 +3265,7 @@ void Test::testToggleRefFlag() m_pDoc->DeleteTab(0); } -void Test::testAutofilter() +CPPUNIT_TEST_FIXTURE(Test, testAutofilter) { m_pDoc->InsertTab( 0, "Test" ); @@ -3600,7 +3375,7 @@ void Test::testAutofilter() m_pDoc->DeleteTab(0); } -void Test::testAutoFilterTimeValue() +CPPUNIT_TEST_FIXTURE(Test, testAutoFilterTimeValue) { m_pDoc->InsertTab(0, "Test"); @@ -3649,7 +3424,7 @@ void Test::testAutoFilterTimeValue() m_pDoc->DeleteTab(0); } -void Test::testAutofilterOptimizations() +CPPUNIT_TEST_FIXTURE(Test, testAutofilterOptimizations) { m_pDoc->InsertTab( 0, "Test" ); @@ -3753,7 +3528,7 @@ void Test::testAutofilterOptimizations() m_pDoc->DeleteTab(0); } -void Test::testTdf76441() +CPPUNIT_TEST_FIXTURE(Test, testTdf76441) { m_pDoc->InsertTab(0, "Test"); @@ -3794,7 +3569,7 @@ void Test::testTdf76441() m_pDoc->DeleteTab(0); } -void Test::testTdf76836() +CPPUNIT_TEST_FIXTURE(Test, testTdf76836) { m_pDoc->InsertTab(0, "Test"); @@ -3824,7 +3599,7 @@ void Test::testTdf76836() m_pDoc->DeleteTab(0); } -void Test::testTdf142186() +CPPUNIT_TEST_FIXTURE(Test, testTdf142186) { m_pDoc->InsertTab(0, "Test"); @@ -3865,7 +3640,7 @@ void Test::testTdf142186() m_pDoc->DeleteTab(0); } -void Test::testTdf137063() +CPPUNIT_TEST_FIXTURE(Test, testTdf137063) { m_pDoc->InsertTab(0, "Test"); @@ -3881,7 +3656,7 @@ void Test::testTdf137063() m_pDoc->DeleteTab(0); } -void Test::testTdf126342() +CPPUNIT_TEST_FIXTURE(Test, testTdf126342) { m_pDoc->InsertTab(0, "Test"); @@ -3912,7 +3687,7 @@ void Test::testTdf126342() m_pDoc->DeleteTab(0); } -void Test::testAdvancedFilter() +CPPUNIT_TEST_FIXTURE(Test, testAdvancedFilter) { m_pDoc->InsertTab(0, "Test"); @@ -4009,7 +3784,7 @@ void Test::testAdvancedFilter() m_pDoc->DeleteTab(0); } -void Test::testDateFilterContains() +CPPUNIT_TEST_FIXTURE(Test, testDateFilterContains) { m_pDoc->InsertTab(0, "Test"); @@ -4063,7 +3838,7 @@ void Test::testDateFilterContains() m_pDoc->DeleteTab(0); } -void Test::testTdf98642() +CPPUNIT_TEST_FIXTURE(Test, testTdf98642) { m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->SetString(0, 0, 0, "test"); @@ -4094,7 +3869,7 @@ void Test::testTdf98642() m_pDoc->DeleteTab(0); } -void Test::testMergedCells() +CPPUNIT_TEST_FIXTURE(Test, testMergedCells) { //test merge and unmerge //TODO: an undo/redo test for this would be a good idea @@ -4115,7 +3890,7 @@ void Test::testMergedCells() m_pDoc->DeleteTab(0); } -void Test::testRenameTable() +CPPUNIT_TEST_FIXTURE(Test, testRenameTable) { //test set rename table //TODO: set name1 and name2 and do an undo to check if name 1 is set now @@ -4160,7 +3935,7 @@ void Test::testRenameTable() m_pDoc->DeleteTab(1); } -void Test::testSetBackgroundColor() +CPPUNIT_TEST_FIXTURE(Test, testSetBackgroundColor) { //test set background color //TODO: set color1 and set color2 and do an undo to check if color1 is set now. @@ -4190,7 +3965,7 @@ void Test::testSetBackgroundColor() m_pDoc->DeleteTab(0); } -void Test::testUpdateReference() +CPPUNIT_TEST_FIXTURE(Test, testUpdateReference) { //test that formulas are correctly updated during sheet delete //TODO: add tests for relative references, updating of named ranges, ... @@ -4277,7 +4052,7 @@ void Test::testUpdateReference() m_pDoc->DeleteTab(0); } -void Test::testSearchCells() +CPPUNIT_TEST_FIXTURE(Test, testSearchCells) { m_pDoc->InsertTab(0, "Test"); @@ -4314,7 +4089,7 @@ void Test::testSearchCells() m_pDoc->DeleteTab(0); } -void Test::testFormulaPosition() +CPPUNIT_TEST_FIXTURE(Test, testFormulaPosition) { m_pDoc->InsertTab(0, "Test"); @@ -4380,8 +4155,12 @@ bool hasRange(const ScDocument* pDoc, const std::vector<ScTokenRef>& rRefTokens, } -void Test::testJumpToPrecedentsDependents() +CPPUNIT_TEST_FIXTURE(Test, testJumpToPrecedentsDependents) { + /** + * Test to make sure correct precedent / dependent cells are obtained when + * preparing to jump to them. + */ // Precedent is another cell that the cell references, while dependent is // another cell that references it. m_pDoc->InsertTab(0, "Test"); @@ -4429,7 +4208,7 @@ void Test::testJumpToPrecedentsDependents() m_pDoc->DeleteTab(0); } -void Test::testTdf149665() +CPPUNIT_TEST_FIXTURE(Test, testTdf149665) { m_pDoc->InsertTab(0, "Test"); @@ -4443,7 +4222,7 @@ void Test::testTdf149665() m_pDoc->DeleteTab(0); } -void Test::testTdf64001() +CPPUNIT_TEST_FIXTURE(Test, testTdf64001) { m_pDoc->InsertTab(0, "test"); @@ -4470,7 +4249,7 @@ void Test::testTdf64001() m_pDoc->DeleteTab(0); } -void Test::testAutoFill() +CPPUNIT_TEST_FIXTURE(Test, testAutoFill) { m_pDoc->InsertTab(0, "test"); @@ -4712,7 +4491,7 @@ void Test::testAutoFill() m_pDoc->DeleteTab(0); } -void Test::testAutoFillSimple() +CPPUNIT_TEST_FIXTURE(Test, testAutoFillSimple) { m_pDoc->InsertTab(0, "test"); @@ -4742,7 +4521,7 @@ void Test::testAutoFillSimple() m_pDoc->DeleteTab(0); } -void Test::testFindAreaPosVertical() +CPPUNIT_TEST_FIXTURE(Test, testFindAreaPosVertical) { std::vector<std::vector<const char*>> aData = { { nullptr, "1", "1" }, @@ -4813,7 +4592,7 @@ void Test::testFindAreaPosVertical() m_pDoc->DeleteTab(0); } -void Test::testFindAreaPosColRight() +CPPUNIT_TEST_FIXTURE(Test, testFindAreaPosColRight) { std::vector<std::vector<const char*>> aData = { { "", "1", "1", "", "1", "1", "1" }, @@ -4873,7 +4652,7 @@ void Test::testFindAreaPosColRight() m_pDoc->DeleteTab(0); } -void Test::testShiftCells() +CPPUNIT_TEST_FIXTURE(Test, testShiftCells) { m_pDoc->InsertTab(0, "foo"); @@ -4913,7 +4692,7 @@ void Test::testShiftCells() m_pDoc->DeleteTab(0); } -void Test::testNoteBasic() +CPPUNIT_TEST_FIXTURE(Test, testNoteBasic) { m_pDoc->InsertTab(0, "PostIts"); @@ -4994,7 +4773,7 @@ void Test::testNoteBasic() m_pDoc->DeleteTab(0); } -void Test::testNoteDeleteRow() +CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteRow) { m_pDoc->InsertTab(0, "Sheet1"); @@ -5078,7 +4857,7 @@ void Test::testNoteDeleteRow() m_pDoc->DeleteTab(0); } -void Test::testNoteDeleteCol() +CPPUNIT_TEST_FIXTURE(Test, testNoteDeleteCol) { m_pDoc->InsertTab(0, "Sheet1"); @@ -5099,7 +4878,7 @@ void Test::testNoteDeleteCol() m_pDoc->DeleteTab(0); } -void Test::testNoteLifeCycle() +CPPUNIT_TEST_FIXTURE(Test, testNoteLifeCycle) { m_pDoc->InsertTab(0, "Test"); @@ -5244,7 +5023,7 @@ void Test::testNoteLifeCycle() m_pDoc->DeleteTab(0); } -void Test::testNoteCopyPaste() +CPPUNIT_TEST_FIXTURE(Test, testNoteCopyPaste) { m_pDoc->InsertTab(0, "Test"); @@ -5306,7 +5085,8 @@ void Test::testNoteCopyPaste() } // tdf#112454 -void Test::testNoteContainsNotesInRange() { +CPPUNIT_TEST_FIXTURE(Test, testNoteContainsNotesInRange) +{ m_pDoc->InsertTab(0, "PostIts"); // We need a drawing layer in order to create caption objects. @@ -5327,7 +5107,7 @@ void Test::testNoteContainsNotesInRange() { m_pDoc->ContainsNotesInRange((ScRange(ScAddress(0, 0, 0), ScAddress(3, 3, 0))))); } -void Test::testAreasWithNotes() +CPPUNIT_TEST_FIXTURE(Test, testAreasWithNotes) { m_pDoc->InsertTab(0, "Sheet1"); @@ -5432,7 +5212,7 @@ void Test::testAreasWithNotes() m_pDoc->DeleteTab(0); } -void Test::testAnchoredRotatedShape() +CPPUNIT_TEST_FIXTURE(Test, testAnchoredRotatedShape) { m_pDoc->InsertTab(0, "TestTab"); SCROW nRow1, nRow2; @@ -5505,7 +5285,7 @@ void Test::testAnchoredRotatedShape() m_pDoc->DeleteTab(0); } -void Test::testCellTextWidth() +CPPUNIT_TEST_FIXTURE(Test, testCellTextWidth) { m_pDoc->InsertTab(0, "Test"); @@ -5624,7 +5404,7 @@ static bool checkEditTextIterator(sc::EditTextIterator& rIter, const char** pChe return false; } -void Test::testEditTextIterator() +CPPUNIT_TEST_FIXTURE(Test, testEditTextIterator) { m_pDoc->InsertTab(0, "Test"); @@ -5685,7 +5465,7 @@ void Test::testEditTextIterator() m_pDoc->DeleteTab(0); } -void Test::testImportStream() +CPPUNIT_TEST_FIXTURE(Test, testImportStream) { sc::AutoCalcSwitch aAC(*m_pDoc, true); // turn on auto calc. sc::UndoSwitch aUndo(*m_pDoc, true); // enable undo. @@ -5738,7 +5518,7 @@ void Test::testImportStream() m_pDoc->DeleteTab(0); } -void Test::testDeleteContents() +CPPUNIT_TEST_FIXTURE(Test, testDeleteContents) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc. sc::UndoSwitch aUndoSwitch(*m_pDoc, true); // enable undo. @@ -5780,7 +5560,7 @@ void Test::testDeleteContents() m_pDoc->DeleteTab(0); } -void Test::testTransliterateText() +CPPUNIT_TEST_FIXTURE(Test, testTransliterateText) { m_pDoc->InsertTab(0, "Test"); @@ -5817,7 +5597,7 @@ void Test::testTransliterateText() m_pDoc->DeleteTab(0); } -void Test::testFormulaToValue() +CPPUNIT_TEST_FIXTURE(Test, testFormulaToValue) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1); @@ -5977,7 +5757,7 @@ void Test::testFormulaToValue() m_pDoc->DeleteTab(0); } -void Test::testFormulaToValue2() +CPPUNIT_TEST_FIXTURE(Test, testFormulaToValue2) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1); @@ -6052,7 +5832,7 @@ void Test::testFormulaToValue2() m_pDoc->DeleteTab(0); } -void Test::testColumnFindEditCells() +CPPUNIT_TEST_FIXTURE(Test, testColumnFindEditCells) { m_pDoc->InsertTab(0, "Test"); @@ -6134,7 +5914,7 @@ void Test::testColumnFindEditCells() } -void Test::testSetFormula() +CPPUNIT_TEST_FIXTURE(Test, testSetFormula) { m_pDoc->InsertTab(0, "Test"); @@ -6164,7 +5944,7 @@ void Test::testSetFormula() m_pDoc->DeleteTab(0); } -void Test::testMultipleDataCellsInRange() +CPPUNIT_TEST_FIXTURE(Test, testMultipleDataCellsInRange) { m_pDoc->InsertTab(0, "Test"); @@ -6218,7 +5998,7 @@ void Test::testMultipleDataCellsInRange() m_pDoc->DeleteTab(0); } -void Test::testFormulaWizardSubformula() +CPPUNIT_TEST_FIXTURE(Test, testFormulaWizardSubformula) { m_pDoc->InsertTab(0, "Test"); @@ -6242,7 +6022,7 @@ void Test::testFormulaWizardSubformula() m_pDoc->DeleteTab(0); } -void Test::testDiagonalBorders() +CPPUNIT_TEST_FIXTURE(Test, testDiagonalBorders) { m_pDoc->InsertTab(0, "Diagonal"); @@ -6313,7 +6093,7 @@ void Test::testDiagonalBorders() m_pDoc->DeleteTab(0); } -void Test::testWholeDocBorders() +CPPUNIT_TEST_FIXTURE(Test, testWholeDocBorders) { m_pDoc->InsertTab(0, "Borders"); @@ -6385,7 +6165,7 @@ void Test::testWholeDocBorders() m_pDoc->DeleteTab(0); } -void Test::testSetStringAndNote() +CPPUNIT_TEST_FIXTURE(Test, testSetStringAndNote) { m_pDoc->InsertTab(0, "Test"); @@ -6405,7 +6185,7 @@ void Test::testSetStringAndNote() m_pDoc->DeleteTab(0); } -void Test::testUndoDataAnchor() +CPPUNIT_TEST_FIXTURE(Test, testUndoDataAnchor) { m_pDoc->InsertTab(0, "Tab1"); CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be only 1 sheets to begin with", @@ -6509,7 +6289,7 @@ void Test::testUndoDataAnchor() } -void Test::testEmptyCalcDocDefaults() +CPPUNIT_TEST_FIXTURE(Test, testEmptyCalcDocDefaults) { CPPUNIT_ASSERT_EQUAL( sal_uInt64(0), m_pDoc->GetCellCount() ); CPPUNIT_ASSERT_EQUAL( sal_uInt64(0), m_pDoc->GetFormulaGroupCount() ); @@ -6601,7 +6381,7 @@ void Test::checkPrecisionAsShown( OUString& rCode, double fValue, double fExpect CPPUNIT_ASSERT_EQUAL_MESSAGE( aMessage.getStr(), fExpectedRoundVal, fRoundValue ); } -void Test::testPrecisionAsShown() +CPPUNIT_TEST_FIXTURE(Test, testPrecisionAsShown) { m_pDoc->InsertTab(0, "Test"); @@ -6742,7 +6522,7 @@ void Test::testPrecisionAsShown() m_pDoc->DeleteTab(0); } -void Test::testProtectedSheetEditByRow() +CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByRow) { ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc(); m_pDoc->InsertTab(0, "Protected"); @@ -6818,7 +6598,7 @@ void Test::testProtectedSheetEditByRow() m_pDoc->DeleteTab(0); } -void Test::testProtectedSheetEditByColumn() +CPPUNIT_TEST_FIXTURE(Test, testProtectedSheetEditByColumn) { ScDocFunc& rDocFunc = m_xDocShell->GetDocFunc(); m_pDoc->InsertTab(0, "Protected"); @@ -6894,7 +6674,7 @@ void Test::testProtectedSheetEditByColumn() m_pDoc->DeleteTab(0); } -void Test::testInsertColumnsWithFormulaCells() +CPPUNIT_TEST_FIXTURE(Test, testInsertColumnsWithFormulaCells) { m_pDoc->InsertTab(0, "Tab1"); @@ -6937,7 +6717,6 @@ void Test::testInsertColumnsWithFormulaCells() m_pDoc->DeleteTab(0); } -CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index b637d724ca6d..811cd0d540d8 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -85,94 +85,11 @@ sal_uInt32 addSingleCellCondFormat(ScDocument* pDoc, const ScAddress& rAddr, sal } - class TestCondformat : public ScUcalcTestBase { -public: - void testCondFormatINSDEL(); - void testCondFormatInsertRow(); - void testCondFormatInsertCol(); - void testCondFormatInsertDeleteSheets(); - void testCondCopyPaste(); - void testCondCopyPasteSingleCell(); //e.g. fdo#82503 - void testCondCopyPasteSingleCellToRange(); //e.g. fdo#82503 - void testCondCopyPasteSingleCellIntoSameFormatRange(); // e.g., tdf#95295 - void testCondCopyPasteSingleRowToRange(); //e.g. tdf#106242 - void testCondCopyPasteSingleRowToRange2(); - void testCondCopyPasteSheetBetweenDoc(); - void testCondCopyPasteSheet(); - - void testIconSet(); - void testDataBarLengthAutomaticAxis(); - void testDataBarLengthMiddleAxis(); - - // Tests for the ScFormulaListener class - void testFormulaListenerSingleCellToSingleCell(); - void testFormulaListenerMultipleCellsToSingleCell(); - void testFormulaListenerSingleCellToMultipleCells(); - void testFormulaListenerMultipleCellsToMultipleCells(); - void testFormulaListenerUpdateInsertTab(); - void testFormulaListenerUpdateDeleteTab(); - - // Check that the Listeners are correctly updated when we - // call an operation - void testCondFormatUpdateMoveTab(); - void testCondFormatUpdateDeleteTab(); - void testCondFormatUpdateInsertTab(); - void testCondFormatUpdateReference(); - void testCondFormatUpdateReferenceDelRow(); - void testCondFormatUpdateReferenceInsRow(); - - void testCondFormatEndsWithStr(); - void testCondFormatEndsWithVal(); - - void testCondFormatUndoList(); - void testMultipleSingleCellCondFormatCopyPaste(); - void testDeduplicateMultipleCondFormats(); - void testCondFormatListenToOwnRange(); - void testCondFormatVolatileFunctionRecalc(); - - CPPUNIT_TEST_SUITE(TestCondformat); - - CPPUNIT_TEST(testCondFormatINSDEL); - CPPUNIT_TEST(testCondFormatInsertRow); - CPPUNIT_TEST(testCondFormatInsertCol); - CPPUNIT_TEST(testCondFormatInsertDeleteSheets); - CPPUNIT_TEST(testCondCopyPaste); - CPPUNIT_TEST(testCondCopyPasteSingleCell); - CPPUNIT_TEST(testCondCopyPasteSingleCellToRange); - CPPUNIT_TEST(testCondCopyPasteSingleCellIntoSameFormatRange); - CPPUNIT_TEST(testCondCopyPasteSingleRowToRange); - CPPUNIT_TEST(testCondCopyPasteSingleRowToRange2); - CPPUNIT_TEST(testCondCopyPasteSheetBetweenDoc); - CPPUNIT_TEST(testCondCopyPasteSheet); - CPPUNIT_TEST(testCondFormatEndsWithStr); - CPPUNIT_TEST(testCondFormatEndsWithVal); - CPPUNIT_TEST(testCondFormatUpdateMoveTab); - CPPUNIT_TEST(testCondFormatUpdateDeleteTab); - CPPUNIT_TEST(testCondFormatUpdateInsertTab); - CPPUNIT_TEST(testCondFormatUpdateReference); - CPPUNIT_TEST(testCondFormatUpdateReferenceDelRow); - CPPUNIT_TEST(testCondFormatUpdateReferenceInsRow); - CPPUNIT_TEST(testCondFormatUndoList); - CPPUNIT_TEST(testMultipleSingleCellCondFormatCopyPaste); - CPPUNIT_TEST(testDeduplicateMultipleCondFormats); - CPPUNIT_TEST(testCondFormatListenToOwnRange); - CPPUNIT_TEST(testCondFormatVolatileFunctionRecalc); - CPPUNIT_TEST(testIconSet); - CPPUNIT_TEST(testDataBarLengthAutomaticAxis); - CPPUNIT_TEST(testDataBarLengthMiddleAxis); - CPPUNIT_TEST(testFormulaListenerSingleCellToSingleCell); - CPPUNIT_TEST(testFormulaListenerSingleCellToMultipleCells); - CPPUNIT_TEST(testFormulaListenerMultipleCellsToSingleCell); - CPPUNIT_TEST(testFormulaListenerMultipleCellsToMultipleCells); - CPPUNIT_TEST(testFormulaListenerUpdateInsertTab); - CPPUNIT_TEST(testFormulaListenerUpdateDeleteTab); - - CPPUNIT_TEST_SUITE_END(); }; -void TestCondformat::testCondFormatINSDEL() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatINSDEL) { // fdo#62206 m_pDoc->InsertTab(0, "Test"); @@ -198,7 +115,7 @@ void TestCondformat::testCondFormatINSDEL() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatInsertCol() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertCol) { m_pDoc->InsertTab(0, "Test"); ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0); @@ -221,7 +138,7 @@ void TestCondformat::testCondFormatInsertCol() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatInsertRow() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertRow) { m_pDoc->InsertTab(0, "Test"); ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0); @@ -244,7 +161,7 @@ void TestCondformat::testCondFormatInsertRow() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatInsertDeleteSheets() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatInsertDeleteSheets) { m_pDoc->InsertTab(0, "Test"); @@ -351,7 +268,7 @@ void TestCondformat::testCondFormatInsertDeleteSheets() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPaste() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPaste) { m_pDoc->InsertTab(0, "Test"); @@ -390,8 +307,9 @@ void TestCondformat::testCondCopyPaste() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSingleCell() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCell) { + //e.g. fdo#82503 m_pDoc->InsertTab(0, "Test"); auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc); @@ -429,8 +347,9 @@ void TestCondformat::testCondCopyPasteSingleCell() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSingleCellToRange() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellToRange) { + //e.g. fdo#82503 m_pDoc->InsertTab(0, "Test"); auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc); @@ -474,8 +393,9 @@ void TestCondformat::testCondCopyPasteSingleCellToRange() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSingleCellIntoSameFormatRange() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleCellIntoSameFormatRange) { + // e.g., tdf#95295 m_pDoc->InsertTab(0, "Test"); auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc); @@ -511,8 +431,9 @@ void TestCondformat::testCondCopyPasteSingleCellIntoSameFormatRange() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSingleRowToRange() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange) { + //e.g. tdf#106242 m_pDoc->InsertTab(0, "Test"); auto pFormat = std::make_unique<ScConditionalFormat>(1, m_pDoc); @@ -543,7 +464,7 @@ void TestCondformat::testCondCopyPasteSingleRowToRange() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSingleRowToRange2() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSingleRowToRange2) { m_pDoc->InsertTab(0, "Test"); @@ -573,7 +494,7 @@ void TestCondformat::testCondCopyPasteSingleRowToRange2() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSheetBetweenDoc() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheetBetweenDoc) { m_pDoc->InsertTab(0, "Test"); @@ -595,7 +516,7 @@ void TestCondformat::testCondCopyPasteSheetBetweenDoc() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondCopyPasteSheet() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondCopyPasteSheet) { m_pDoc->InsertTab(0, "Test"); @@ -628,7 +549,7 @@ void TestCondformat::testCondCopyPasteSheet() m_pDoc->DeleteTab(0); } -void TestCondformat::testIconSet() +CPPUNIT_TEST_FIXTURE(TestCondformat, testIconSet) { m_pDoc->InsertTab(0, "Test"); ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0); @@ -667,7 +588,7 @@ void TestCondformat::testIconSet() m_pDoc->DeleteTab(0); } -void TestCondformat::testDataBarLengthAutomaticAxis() +CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthAutomaticAxis) { m_pDoc->InsertTab(0, "Test"); @@ -731,7 +652,7 @@ void TestCondformat::testDataBarLengthAutomaticAxis() m_pDoc->DeleteTab(0); } -void TestCondformat::testDataBarLengthMiddleAxis() +CPPUNIT_TEST_FIXTURE(TestCondformat, testDataBarLengthMiddleAxis) { m_pDoc->InsertTab(0, "Test"); @@ -776,7 +697,7 @@ void TestCondformat::testDataBarLengthMiddleAxis() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatEndsWithStr() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatEndsWithStr) { m_pDoc->InsertTab(0, "Test"); @@ -795,7 +716,7 @@ void TestCondformat::testCondFormatEndsWithStr() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatEndsWithVal() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatEndsWithVal) { m_pDoc->InsertTab(0, "Test"); @@ -815,7 +736,7 @@ void TestCondformat::testCondFormatEndsWithVal() m_pDoc->DeleteTab(0); } -void TestCondformat::testFormulaListenerSingleCellToSingleCell() +CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToSingleCell) { m_pDoc->InsertTab(0, "test"); @@ -833,7 +754,7 @@ void TestCondformat::testFormulaListenerSingleCellToSingleCell() m_pDoc->DeleteTab(0); } -void TestCondformat::testFormulaListenerSingleCellToMultipleCells() +CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerSingleCellToMultipleCells) { m_pDoc->InsertTab(0, "test"); @@ -851,7 +772,7 @@ void TestCondformat::testFormulaListenerSingleCellToMultipleCells() m_pDoc->DeleteTab(0); } -void TestCondformat::testFormulaListenerMultipleCellsToSingleCell() +CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToSingleCell) { m_pDoc->InsertTab(0, "test"); @@ -869,7 +790,7 @@ void TestCondformat::testFormulaListenerMultipleCellsToSingleCell() m_pDoc->DeleteTab(0); } -void TestCondformat::testFormulaListenerMultipleCellsToMultipleCells() +CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerMultipleCellsToMultipleCells) { m_pDoc->InsertTab(0, "test"); @@ -887,7 +808,7 @@ void TestCondformat::testFormulaListenerMultipleCellsToMultipleCells() m_pDoc->DeleteTab(0); } -void TestCondformat::testFormulaListenerUpdateInsertTab() +CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateInsertTab) { m_pDoc->InsertTab(0, "test"); @@ -911,7 +832,7 @@ void TestCondformat::testFormulaListenerUpdateInsertTab() m_pDoc->DeleteTab(0); } -void TestCondformat::testFormulaListenerUpdateDeleteTab() +CPPUNIT_TEST_FIXTURE(TestCondformat, testFormulaListenerUpdateDeleteTab) { m_pDoc->InsertTab(0, "test"); m_pDoc->InsertTab(0, "to_delete"); @@ -932,7 +853,7 @@ void TestCondformat::testFormulaListenerUpdateDeleteTab() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUpdateMoveTab() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateMoveTab) { m_pDoc->InsertTab(0, "test"); m_pDoc->InsertTab(1, "Test2"); @@ -969,7 +890,7 @@ void TestCondformat::testCondFormatUpdateMoveTab() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUpdateInsertTab() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateInsertTab) { m_pDoc->InsertTab(0, "test"); @@ -1008,7 +929,7 @@ void TestCondformat::testCondFormatUpdateInsertTab() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUpdateDeleteTab() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateDeleteTab) { m_pDoc->InsertTab(0, "test"); m_pDoc->InsertTab(1, "Test2"); @@ -1041,7 +962,7 @@ void TestCondformat::testCondFormatUpdateDeleteTab() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUpdateReference() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReference) { m_pDoc->InsertTab(0, "test"); m_pDoc->InsertTab(1, "Test2"); @@ -1066,7 +987,7 @@ void TestCondformat::testCondFormatUpdateReference() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUpdateReferenceDelRow() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceDelRow) { m_pDoc->InsertTab(0, "test"); @@ -1087,7 +1008,7 @@ void TestCondformat::testCondFormatUpdateReferenceDelRow() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUpdateReferenceInsRow() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUpdateReferenceInsRow) { m_pDoc->InsertTab(0, "test"); @@ -1108,7 +1029,7 @@ void TestCondformat::testCondFormatUpdateReferenceInsRow() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatUndoList() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatUndoList) { m_pDoc->InsertTab(0, "test"); @@ -1150,7 +1071,7 @@ void TestCondformat::testCondFormatUndoList() m_pDoc->DeleteTab(0); } -void TestCondformat::testMultipleSingleCellCondFormatCopyPaste() +CPPUNIT_TEST_FIXTURE(TestCondformat, testMultipleSingleCellCondFormatCopyPaste) { m_pDoc->InsertTab(0, "Test"); @@ -1182,7 +1103,7 @@ void TestCondformat::testMultipleSingleCellCondFormatCopyPaste() m_pDoc->DeleteTab(0); } -void TestCondformat::testDeduplicateMultipleCondFormats() +CPPUNIT_TEST_FIXTURE(TestCondformat, testDeduplicateMultipleCondFormats) { m_pDoc->InsertTab(0, "Test"); @@ -1214,7 +1135,7 @@ void TestCondformat::testDeduplicateMultipleCondFormats() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatListenToOwnRange() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatListenToOwnRange) { m_pDoc->InsertTab(0, "Test"); @@ -1248,7 +1169,7 @@ void TestCondformat::testCondFormatListenToOwnRange() m_pDoc->DeleteTab(0); } -void TestCondformat::testCondFormatVolatileFunctionRecalc() +CPPUNIT_TEST_FIXTURE(TestCondformat, testCondFormatVolatileFunctionRecalc) { m_pDoc->InsertTab(0, "Test"); @@ -1287,8 +1208,6 @@ void TestCondformat::testCondFormatVolatileFunctionRecalc() m_pDoc->DeleteTab(0); } -CPPUNIT_TEST_SUITE_REGISTRATION(TestCondformat); - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/ucalc_copypaste.cxx b/sc/qa/unit/ucalc_copypaste.cxx index 5db90a4daa21..c54107e08998 100644 --- a/sc/qa/unit/ucalc_copypaste.cxx +++ b/sc/qa/unit/ucalc_copypaste.cxx @@ -34,215 +34,7 @@ class TestCopyPaste : public ScUcalcTestBase { -public: - void testCopyPaste(); - void testCopyPasteAsLink(); - void testCopyPasteTranspose(); - void testCopyPasteSpecialAsLinkTranspose(); - void testCopyPasteSpecialAsLinkFilteredTranspose(); - void testCopyPasteSpecialMultiRangeColAsLinkTranspose(); - void testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose(); - void testCopyPasteSpecialMultiRangeRowAsLinkTranspose(); - void testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose(); - void testCopyPasteSpecialAllAsLinkTranspose(); - void testCopyPasteSpecialAllAsLinkFilteredTranspose(); - void testCopyPasteSpecial(); - void testCopyPasteSpecialFiltered(); - void testCopyPasteSpecialIncludeFiltered(); - void testCopyPasteSpecialFilteredIncludeFiltered(); - void testCopyPasteSpecialTranspose(); - void testCopyPasteSpecialTransposeIncludeFiltered(); - void testCopyPasteSpecialFilteredTranspose(); - void testCopyPasteSpecialMergedCellsTranspose(); - void testCopyPasteSpecialMergedCellsFilteredTranspose(); - void testCopyPasteSpecialMultiRangeCol(); - void testCopyPasteSpecialMultiRangeColFiltered(); - void testCopyPasteSpecialMultiRangeColIncludeFiltered(); - void testCopyPasteSpecialMultiRangeColFilteredIncludeFiltered(); - void testCopyPasteSpecialMultiRangeColTranspose(); - void testCopyPasteSpecialMultiRangeColFilteredTranspose(); - void testCopyPasteSpecialMultiRangeColFilteredIncludeFilteredTranspose(); - void testCopyPasteSpecialMultiRangeRow(); - void testCopyPasteSpecialMultiRangeRowFiltered(); - void testCopyPasteSpecialMultiRangeRowIncludeFiltered(); - void testCopyPasteSpecialMultiRangeRowFilteredIncludeFiltered(); - void testCopyPasteSpecialMultiRangeRowTranspose(); - void testCopyPasteSpecialMultiRangeRowFilteredTranspose(); - void testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTranspose(); - void testCopyPasteSpecialSkipEmpty(); - void testCopyPasteSpecialSkipEmptyFiltered(); - void testCopyPasteSpecialSkipEmptyIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyTranspose(); - void testCopyPasteSpecialSkipEmptyTransposeIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyFilteredTranspose(); - void testCopyPasteSpecialSkipEmptyMultiRangeCol(); - void testCopyPasteSpecialSkipEmptyMultiRangeColFiltered(); - void testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyMultiRangeColTranspose(); - void testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose(); - void testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFilteredTranspose(); - void testCopyPasteSpecialSkipEmptyMultiRangeRow(); - void testCopyPasteSpecialSkipEmptyMultiRangeRowFiltered(); - void testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFiltered(); - void testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose(); - void testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose(); - void testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFilteredTranspose(); - void testCopyPasteMultiRange(); - void testCopyPasteSkipEmpty(); - void testCopyPasteSkipEmpty2(); - void testCutPasteRefUndo(); - void testCutPasteGroupRefUndo(); - void testMoveRefBetweenSheets(); - void testUndoCut(); - void testMoveBlock(); - void testCopyPasteRelativeFormula(); - void testCopyPasteRepeatOneFormula(); - void testCopyPasteMixedReferenceFormula(); - void testCopyPasteFormulas(); - void testCopyPasteFormulasExternalDoc(); - void testCopyPasteReferencesExternalDoc(); // tdf#106456 - void testTdf68976(); - void testTdf71058(); - void testTdf149554(); - - void testCutPasteSpecial(); - void testCutPasteSpecialTranspose(); - void testCutPasteSpecialSkipEmpty(); - void testCutPasteSpecialSkipEmptyTranspose(); - void testTdf142201Row(); - void testTdf142201ColRel(); - void testTdf142201ColAbs(); - void testTdf142065(); - void testCutTransposedFormulas(); - void testCutTransposedFormulasSquare(); - void testReferencedCutRangesRow(); - void testReferencedCutTransposedRangesRowTab0To0(); - void testReferencedCutTransposedRangesRowTab0To1(); - void testReferencedCutTransposedRangesRowTab1To3(); - void testReferencedCutTransposedRangesRowTab3To1(); - void testReferencedCutRangesCol(); - void testReferencedCutTransposedRangesColTab0To0(); - void testReferencedCutTransposedRangesColTab0To1(); - void testReferencedCutTransposedRangesColTab1To3(); - void testReferencedCutTransposedRangesColTab3To1(); - - void testMixData(); - void testMixDataAsLinkTdf116413(); - void testMixDataWithFormulaTdf116413(); - - // tdf#80137 - void testCopyPasteMatrixFormula(); - - CPPUNIT_TEST_SUITE(TestCopyPaste); - - CPPUNIT_TEST(testCopyPaste); - CPPUNIT_TEST(testCopyPasteAsLink); - CPPUNIT_TEST(testCopyPasteTranspose); - CPPUNIT_TEST(testCopyPasteSpecialAsLinkTranspose); - CPPUNIT_TEST(testCopyPasteSpecialAllAsLinkTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColAsLinkTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowAsLinkTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialAsLinkFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialAllAsLinkFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMergedCellsTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMergedCellsFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecial); - CPPUNIT_TEST(testCopyPasteSpecialFiltered); - CPPUNIT_TEST(testCopyPasteSpecialIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialFilteredIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialTranspose); - CPPUNIT_TEST(testCopyPasteSpecialTransposeIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeCol); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFiltered); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFilteredIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFilteredIncludeFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRow); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFiltered); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFilteredIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmpty); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyTransposeIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeCol); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRow); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFiltered); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose); - CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFilteredTranspose); - CPPUNIT_TEST(testCopyPasteMultiRange); - CPPUNIT_TEST(testCopyPasteSkipEmpty); - CPPUNIT_TEST(testCopyPasteSkipEmpty2); - CPPUNIT_TEST(testCutPasteRefUndo); - CPPUNIT_TEST(testCutPasteGroupRefUndo); - CPPUNIT_TEST(testMoveRefBetweenSheets); - CPPUNIT_TEST(testUndoCut); - CPPUNIT_TEST(testMoveBlock); - CPPUNIT_TEST(testCopyPasteRelativeFormula); - CPPUNIT_TEST(testCopyPasteRepeatOneFormula); - CPPUNIT_TEST(testCopyPasteMixedReferenceFormula); - - CPPUNIT_TEST(testCopyPasteFormulas); - CPPUNIT_TEST(testCopyPasteFormulasExternalDoc); - CPPUNIT_TEST(testCopyPasteReferencesExternalDoc); - - CPPUNIT_TEST(testTdf68976); - CPPUNIT_TEST(testTdf71058); - CPPUNIT_TEST(testTdf149554); - - CPPUNIT_TEST(testCutPasteSpecial); - CPPUNIT_TEST(testCutPasteSpecialTranspose); - CPPUNIT_TEST(testCutPasteSpecialSkipEmpty); - CPPUNIT_TEST(testCutPasteSpecialSkipEmptyTranspose); - CPPUNIT_TEST(testTdf142201Row); - CPPUNIT_TEST(testTdf142201ColRel); - CPPUNIT_TEST(testTdf142201ColAbs); - CPPUNIT_TEST(testTdf142065); - CPPUNIT_TEST(testCutTransposedFormulas); - CPPUNIT_TEST(testCutTransposedFormulasSquare); - CPPUNIT_TEST(testReferencedCutRangesRow); - CPPUNIT_TEST(testReferencedCutTransposedRangesRowTab0To0); - CPPUNIT_TEST(testReferencedCutTransposedRangesRowTab0To1); - CPPUNIT_TEST(testReferencedCutTransposedRangesRowTab1To3); - CPPUNIT_TEST(testReferencedCutTransposedRangesRowTab3To1); - CPPUNIT_TEST(testReferencedCutRangesCol); - CPPUNIT_TEST(testReferencedCutTransposedRangesColTab0To0); - CPPUNIT_TEST(testReferencedCutTransposedRangesColTab0To1); - CPPUNIT_TEST(testReferencedCutTransposedRangesColTab1To3); - CPPUNIT_TEST(testReferencedCutTransposedRangesColTab3To1); - - CPPUNIT_TEST(testMixData); - CPPUNIT_TEST(testMixDataAsLinkTdf116413); - CPPUNIT_TEST(testMixDataWithFormulaTdf116413); - - CPPUNIT_TEST(testCopyPasteMatrixFormula); - - CPPUNIT_TEST_SUITE_END(); - -private: +protected: enum CalcMode { NoCalc, @@ -436,7 +228,7 @@ void TestCopyPaste::prepareUndoAfterPaste(ScDocumentUniquePtr& pPasteUndoDoc, &aOptions)); // false = Redo data not yet copied } -void TestCopyPaste::testCopyPaste() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPaste) { m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->InsertTab(1, "Sheet2"); @@ -615,7 +407,7 @@ void TestCopyPaste::testCopyPaste() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteAsLink() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteAsLink) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // Turn on auto calc. @@ -654,7 +446,7 @@ void TestCopyPaste::testCopyPasteAsLink() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteTranspose) { m_pDoc->InsertTab(0, "Sheet1"); @@ -712,7 +504,7 @@ void TestCopyPaste::testCopyPasteTranspose() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteSpecialMergedCellsTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMergedCellsTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -781,7 +573,7 @@ void TestCopyPaste::testCopyPasteSpecialMergedCellsTranspose() m_pDoc->DeleteTab(srcSheet); } -void TestCopyPaste::testCopyPasteSpecialMergedCellsFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMergedCellsFilteredTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -872,7 +664,7 @@ void TestCopyPaste::testCopyPasteSpecialMergedCellsFilteredTranspose() } // InsertDeleteFlags::CONTENTS -void TestCopyPaste::testCopyPasteSpecialAsLinkTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -928,7 +720,7 @@ void TestCopyPaste::testCopyPasteSpecialAsLinkTranspose() } // InsertDeleteFlags::CONTENTS -void TestCopyPaste::testCopyPasteSpecialAsLinkFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAsLinkFilteredTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -1016,7 +808,7 @@ void TestCopyPaste::testCopyPasteSpecialAsLinkFilteredTranspose() // tdf#141683 // InsertDeleteFlags::VALUE -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowAsLinkTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -1105,7 +897,7 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeRowAsLinkTranspose() // tdf#141683 // InsertDeleteFlags::VALUE -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -1256,7 +1048,7 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose() // tdf#141683 // InsertDeleteFlags::VALUE -void TestCopyPaste::testCopyPasteSpecialMultiRangeColAsLinkTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -1345,7 +1137,7 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeColAsLinkTranspose() // tdf#141683 // InsertDeleteFlags::VALUE -void TestCopyPaste::testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -1445,7 +1237,7 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose() } // InsertDeleteFlags::ALL -void TestCopyPaste::testCopyPasteSpecialAllAsLinkTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAllAsLinkTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -1504,7 +1296,7 @@ void TestCopyPaste::testCopyPasteSpecialAllAsLinkTranspose() } // InsertDeleteFlags::ALL -void TestCopyPaste::testCopyPasteSpecialAllAsLinkFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialAllAsLinkFilteredTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -2154,26 +1946,26 @@ void TestCopyPaste::executeCopyPasteSpecial(const SCTAB srcSheet, const SCTAB de m_pDoc->CalcAll(); } -void TestCopyPaste::testCopyPasteSpecial() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecial) { executeCopyPasteSpecial(false, false, false, false, false, false); checkCopyPasteSpecial(false); } -void TestCopyPaste::testCopyPasteSpecialFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialFiltered) { executeCopyPasteSpecial(true, false, false, false, false, false); checkCopyPasteSpecialFiltered(false); } -void TestCopyPaste::testCopyPasteSpecialIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(false, true, false, false, false, false); checkCopyPasteSpecial(false); } -void TestCopyPaste::testCopyPasteSpecialFilteredIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialFilteredIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, false, false, false); @@ -2181,34 +1973,34 @@ void TestCopyPaste::testCopyPasteSpecialFilteredIncludeFiltered() } // similar to TestCopyPaste::testCopyPasteTranspose(), but this test is more complex -void TestCopyPaste::testCopyPasteSpecialTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialTranspose) { executeCopyPasteSpecial(false, false, false, true, false, false); checkCopyPasteSpecialTranspose(false); } // tdf#107348 -void TestCopyPaste::testCopyPasteSpecialFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialFilteredTranspose) { executeCopyPasteSpecial(true, false, false, true, false, false); checkCopyPasteSpecialFilteredTranspose(false); } // tdf#107348 -void TestCopyPaste::testCopyPasteSpecialTransposeIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialTransposeIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, true, false, false); checkCopyPasteSpecialTranspose(false); } -void TestCopyPaste::testCopyPasteSpecialMultiRangeCol() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeCol) { executeCopyPasteSpecial(false, false, false, false, true, false, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeCol(false); } -void TestCopyPaste::testCopyPasteSpecialMultiRangeColIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(false, true, false, false, true, false, false, ScClipParam::Column); @@ -2216,48 +2008,49 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeColIncludeFiltered() } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialMultiRangeColFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColFiltered) { executeCopyPasteSpecial(true, false, false, false, true, false, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColFiltered(false); } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialMultiRangeColFilteredIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColFilteredIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, false, true, false, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeCol(false); } -void TestCopyPaste::testCopyPasteSpecialMultiRangeColTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColTranspose) { executeCopyPasteSpecial(false, false, false, true, true, false, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColTranspose(false); } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialMultiRangeColFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeColFilteredTranspose) { executeCopyPasteSpecial(true, false, false, true, true, false, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColFilteredTranspose(false); } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialMultiRangeColFilteredIncludeFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, + testCopyPasteSpecialMultiRangeColFilteredIncludeFilteredTranspose) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, true, true, false, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColTranspose(false); } -void TestCopyPaste::testCopyPasteSpecialMultiRangeRow() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRow) { executeCopyPasteSpecial(false, false, false, false, true, false, false, ScClipParam::Row); checkCopyPasteSpecialMultiRangeRow(false); } -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(false, true, false, false, true, false, false, ScClipParam::Row); @@ -2265,21 +2058,21 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeRowIncludeFiltered() } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowFiltered) { executeCopyPasteSpecial(true, false, false, false, true, false, false, ScClipParam::Row); checkCopyPasteSpecialMultiRangeRowFiltered(false); } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowFilteredIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowFilteredIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, false, true, false, false, ScClipParam::Row); checkCopyPasteSpecialMultiRangeRow(false); } -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowTranspose) { executeCopyPasteSpecial(false, false, false, true, true, false, false, ScClipParam::Row, HardRecalcAtEnd); @@ -2287,7 +2080,7 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeRowTranspose() } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialMultiRangeRowFilteredTranspose) { executeCopyPasteSpecial(true, false, false, true, true, false, false, ScClipParam::Row, HardRecalcAtEnd); @@ -2295,7 +2088,8 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeRowFilteredTranspose() } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, + testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTranspose) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, true, true, false, false, ScClipParam::Row, @@ -2303,26 +2097,26 @@ void TestCopyPaste::testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTran checkCopyPasteSpecialMultiRangeRowTranspose(false); } -void TestCopyPaste::testCopyPasteSpecialSkipEmpty() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmpty) { executeCopyPasteSpecial(false, false, false, false, false, true); checkCopyPasteSpecial(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyFiltered) { executeCopyPasteSpecial(true, false, false, false, false, true); checkCopyPasteSpecialFiltered(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(false, true, false, false, false, true); checkCopyPasteSpecial(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, false, false, true); @@ -2330,34 +2124,34 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered() } // similar to TestCopyPaste::testCopyPasteTranspose(), but this test is more complex -void TestCopyPaste::testCopyPasteSpecialSkipEmptyTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyTranspose) { executeCopyPasteSpecial(false, false, false, true, false, true); checkCopyPasteSpecialTranspose(true); } // tdf#107348 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyFilteredTranspose) { executeCopyPasteSpecial(true, false, false, true, false, true); checkCopyPasteSpecialFilteredTranspose(true); } // tdf#107348 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyTransposeIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyTransposeIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, true, false, true); checkCopyPasteSpecialTranspose(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeCol() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeCol) { executeCopyPasteSpecial(false, false, false, false, true, true, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeCol(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(false, true, false, false, true, true, false, ScClipParam::Column); @@ -2365,28 +2159,29 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered() } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeColFiltered) { executeCopyPasteSpecial(true, false, false, false, true, true, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColFiltered(true); } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, + testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, false, true, true, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeCol(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeColTranspose) { executeCopyPasteSpecial(false, false, false, true, true, true, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColTranspose(true); } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, false, false, true, true, true, false, ScClipParam::Column); @@ -2394,20 +2189,21 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose( } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, + testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFilteredTranspose) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, true, true, true, false, ScClipParam::Column); checkCopyPasteSpecialMultiRangeColTranspose(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRow() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeRow) { executeCopyPasteSpecial(false, false, false, false, true, true, false, ScClipParam::Row); checkCopyPasteSpecialMultiRangeRow(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(false, true, false, false, true, true, false, ScClipParam::Row); @@ -2415,21 +2211,22 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered() } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeRowFiltered) { executeCopyPasteSpecial(true, false, false, false, true, true, false, ScClipParam::Row); checkCopyPasteSpecialMultiRangeRowFiltered(true); } // tdf#45958 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFiltered() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, + testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFiltered) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, false, true, true, false, ScClipParam::Row); checkCopyPasteSpecialMultiRangeRow(true); } -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose) { executeCopyPasteSpecial(false, false, false, true, true, true, false, ScClipParam::Row, HardRecalcAtEnd); @@ -2437,7 +2234,7 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose() } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose) { executeCopyPasteSpecial(true, false, false, true, true, true, false, ScClipParam::Row, HardRecalcAtEnd); @@ -2445,7 +2242,8 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose( } // tdf#45958, tdf#107348 -void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFilteredTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, + testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFilteredTranspose) { // For bIncludeFiltered=true, the non-filtered outcome is expected executeCopyPasteSpecial(true, true, false, true, true, true, false, ScClipParam::Row, @@ -2453,7 +2251,7 @@ void TestCopyPaste::testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFil checkCopyPasteSpecialMultiRangeRowTranspose(true); } -void TestCopyPaste::testCutPasteSpecial() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteSpecial) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -2483,7 +2281,7 @@ void TestCopyPaste::testCutPasteSpecial() m_pDoc->DeleteTab(i - 1); } -void TestCopyPaste::testCutPasteSpecialTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteSpecialTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -2513,7 +2311,7 @@ void TestCopyPaste::testCutPasteSpecialTranspose() m_pDoc->DeleteTab(i - 1); } -void TestCopyPaste::testCutPasteSpecialSkipEmpty() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteSpecialSkipEmpty) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -2543,7 +2341,7 @@ void TestCopyPaste::testCutPasteSpecialSkipEmpty() m_pDoc->DeleteTab(i - 1); } -void TestCopyPaste::testCutPasteSpecialSkipEmptyTranspose() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteSpecialSkipEmptyTranspose) { const SCTAB srcSheet = 0; const SCTAB destSheet = 1; @@ -7066,7 +6864,7 @@ void TestCopyPaste::checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSk m_pDoc->DeleteTab(srcSheet); } -void TestCopyPaste::testTdf142201Row() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201Row) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -7141,7 +6939,7 @@ void TestCopyPaste::testTdf142201Row() CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(1, 4, nTab)); } -void TestCopyPaste::testTdf142201ColRel() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201ColRel) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -7216,7 +7014,7 @@ void TestCopyPaste::testTdf142201ColRel() CPPUNIT_ASSERT_EQUAL(OUString("=B2"), m_pDoc->GetFormula(1, 4, nTab)); } -void TestCopyPaste::testTdf142201ColAbs() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142201ColAbs) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -8142,7 +7940,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesRow(const SCTAB nSrcTab, c CPPUNIT_ASSERT_EQUAL(36.0, m_pDoc->GetValue(2, 101, nSrcTab)); // only 2nd row } -void TestCopyPaste::testReferencedCutRangesRow() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutRangesRow) { const SCTAB nSrcTab = 0; const SCTAB nDestTab = 2; @@ -8171,25 +7969,25 @@ void TestCopyPaste::testReferencedCutRangesRow() } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesRowTab0To0() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesRowTab0To0) { checkReferencedCutTransposedRangesRowUndo(0, 0); } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesRowTab0To1() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesRowTab0To1) { checkReferencedCutTransposedRangesRowUndo(0, 1); } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesRowTab1To3() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesRowTab1To3) { checkReferencedCutTransposedRangesRowUndo(1, 3); } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesRowTab3To1() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesRowTab3To1) { checkReferencedCutTransposedRangesRowUndo(3, 1); } @@ -9121,7 +8919,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesCol(const SCTAB nSrcTab, c CPPUNIT_ASSERT_EQUAL(OUString(aFBase + "E14"), m_pDoc->GetFormula(2, 114, nSrcTab)); } -void TestCopyPaste::testReferencedCutRangesCol() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutRangesCol) { const SCTAB nSrcTab = 0; const SCTAB nDestTab = 2; @@ -9150,25 +8948,25 @@ void TestCopyPaste::testReferencedCutRangesCol() } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesColTab0To0() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesColTab0To0) { checkReferencedCutTransposedRangesColUndo(0, 0); } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesColTab0To1() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesColTab0To1) { checkReferencedCutTransposedRangesColUndo(0, 1); } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesColTab1To3() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesColTab1To3) { checkReferencedCutTransposedRangesColUndo(1, 3); } // tdf#142201 -void TestCopyPaste::testReferencedCutTransposedRangesColTab3To1() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testReferencedCutTransposedRangesColTab3To1) { checkReferencedCutTransposedRangesColUndo(3, 1); } @@ -9201,7 +8999,7 @@ void TestCopyPaste::checkReferencedCutTransposedRangesColUndo(const SCTAB nSrcTa m_pDoc->DeleteTab(i - 1); } -void TestCopyPaste::testCutTransposedFormulas() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulas) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -9258,7 +9056,7 @@ void TestCopyPaste::testCutTransposedFormulas() CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(2, 7, nTab)); } -void TestCopyPaste::testCutTransposedFormulasSquare() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutTransposedFormulasSquare) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -9328,7 +9126,7 @@ void TestCopyPaste::testCutTransposedFormulasSquare() CPPUNIT_ASSERT_EQUAL(OUString("=C2"), m_pDoc->GetFormula(2, 8, nTab)); } -void TestCopyPaste::testTdf142065() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf142065) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -9406,7 +9204,7 @@ void TestCopyPaste::testTdf142065() CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(0, 7, nTab)); } -void TestCopyPaste::testCopyPasteMultiRange() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMultiRange) { m_pDoc->InsertTab(0, "Test"); @@ -9455,7 +9253,7 @@ void TestCopyPaste::testCopyPasteMultiRange() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteSkipEmpty() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty) { struct Check { @@ -9647,7 +9445,7 @@ void TestCopyPaste::testCopyPasteSkipEmpty() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteSkipEmpty2() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteSkipEmpty2) { m_pDoc->InsertTab(0, "Test"); @@ -9674,7 +9472,7 @@ void TestCopyPaste::testCopyPasteSkipEmpty2() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCutPasteRefUndo() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteRefUndo) { // Testing scenario: A2 references B2, and B2 gets cut and pasted onto C2, // which updates A2's formula to reference C2. Then the paste action gets @@ -9724,7 +9522,7 @@ void TestCopyPaste::testCutPasteRefUndo() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCutPasteGroupRefUndo() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCutPasteGroupRefUndo) { // Test that Cut&Paste part of a grouped formula adjusts references // correctly and Undo works. @@ -9831,7 +9629,7 @@ void TestCopyPaste::testCutPasteGroupRefUndo() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testMoveRefBetweenSheets() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveRefBetweenSheets) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc. @@ -9874,7 +9672,7 @@ void TestCopyPaste::testMoveRefBetweenSheets() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testUndoCut() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testUndoCut) { m_pDoc->InsertTab(0, "Test"); @@ -9927,7 +9725,7 @@ void TestCopyPaste::testUndoCut() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testMoveBlock() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMoveBlock) { m_pDoc->InsertTab(0, "SheetNotes"); @@ -9981,7 +9779,7 @@ void TestCopyPaste::testMoveBlock() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteRelativeFormula() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRelativeFormula) { m_pDoc->InsertTab(0, "Formula"); @@ -10046,7 +9844,7 @@ void TestCopyPaste::testCopyPasteRelativeFormula() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteRepeatOneFormula() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteRepeatOneFormula) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); @@ -10168,7 +9966,7 @@ void TestCopyPaste::testCopyPasteRepeatOneFormula() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteMixedReferenceFormula() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMixedReferenceFormula) { sc::AutoCalcSwitch aAC(*m_pDoc, true); // turn on auto calc. m_pDoc->InsertTab(0, "Test"); @@ -10207,7 +10005,7 @@ void TestCopyPaste::testCopyPasteMixedReferenceFormula() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testCopyPasteFormulas() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulas) { m_pDoc->InsertTab(0, "Sheet1"); m_pDoc->InsertTab(1, "Sheet2"); @@ -10236,7 +10034,7 @@ void TestCopyPaste::testCopyPasteFormulas() CPPUNIT_ASSERT_EQUAL(OUString("=$Sheet2.K$1"), m_pDoc->GetFormula(10, 14, 0)); } -void TestCopyPaste::testCopyPasteFormulasExternalDoc() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteFormulasExternalDoc) { SfxMedium* pMedium = new SfxMedium("file:///source.fake", StreamMode::STD_READWRITE); m_xDocShell->DoLoad(pMedium); @@ -10293,7 +10091,7 @@ void TestCopyPaste::testCopyPasteFormulasExternalDoc() xExtDocSh->DoClose(); } -void TestCopyPaste::testCopyPasteReferencesExternalDoc() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteReferencesExternalDoc) { SfxMedium* pMedium = new SfxMedium("file:///source.fake", StreamMode::STD_READWRITE); m_xDocShell->DoLoad(pMedium); @@ -10331,7 +10129,7 @@ void TestCopyPaste::testCopyPasteReferencesExternalDoc() xExtDocSh->DoClose(); } -void TestCopyPaste::testTdf68976() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf68976) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -10374,7 +10172,7 @@ void TestCopyPaste::testTdf68976() CPPUNIT_ASSERT_EQUAL(1000.0, m_pDoc->GetValue(1, 3, nTab)); // B4 } -void TestCopyPaste::testTdf71058() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf71058) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -10428,7 +10226,7 @@ void TestCopyPaste::testTdf71058() CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(3, 2, nTab)); } -void TestCopyPaste::testTdf149554() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testTdf149554) { const SCTAB nTab = 0; m_pDoc->InsertTab(nTab, "Test"); @@ -10456,7 +10254,7 @@ void TestCopyPaste::testTdf149554() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testMixData() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixData) { m_pDoc->InsertTab(0, "Test"); @@ -10512,7 +10310,7 @@ void TestCopyPaste::testMixData() m_pDoc->DeleteTab(0); } -void TestCopyPaste::testMixDataAsLinkTdf116413() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataAsLinkTdf116413) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation. @@ -10662,7 +10460,7 @@ void TestCopyPaste::testMixDataAsLinkTdf116413() m_pDoc->DeleteTab(nTab); } -void TestCopyPaste::testMixDataWithFormulaTdf116413() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testMixDataWithFormulaTdf116413) { sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calculation. @@ -10838,8 +10636,9 @@ void TestCopyPaste::testMixDataWithFormulaTdf116413() m_pDoc->DeleteTab(nTab); } -void TestCopyPaste::testCopyPasteMatrixFormula() +CPPUNIT_TEST_FIXTURE(TestCopyPaste, testCopyPasteMatrixFormula) { + // tdf#80137 m_pDoc->InsertTab(0, "hcv"); // Set Values to B1, C1, D1 @@ -10905,8 +10704,6 @@ void TestCopyPaste::testCopyPasteMatrixFormula() m_pDoc->DeleteTab(0); } -CPPUNIT_TEST_SUITE_REGISTRATION(TestCopyPaste); - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/ucalc_datatransformation.cxx b/sc/qa/unit/ucalc_datatransformation.cxx index b26604c63110..64fa91c399a5 100644 --- a/sc/qa/unit/ucalc_datatransformation.cxx +++ b/sc/qa/unit/ucalc_datatransformation.cxx @@ -18,99 +18,10 @@ class ScDataTransformationTest : public ScUcalcTestBase { public: - virtual void setUp() override; - - void testColumnRemove(); - void testColumnSplit(); - void testColumnMerge(); - void testTextToLower(); - void testTextToUpper(); - void testTextCapitalize(); - void testTextTrim(); - void testAggregateSum(); - void testAggregateAverage(); - void testAggregateMin(); - void testAggregateMax(); - void testNumberRound(); - void testNumberRoundUp(); - void testNumberRoundDown(); - void testNumberAbsolute(); - void testNumberLogE(); - void testNumberLog10(); - void testNumberCube(); - void testNumberSquare(); - void testNumberSquareRoot(); - void testNumberEven(); - void testNumberOdd(); - void testNumberSign(); - void testReplaceNull(); - void testGetDateString(); - void testGetYear(); - void testGetStartOfYear(); - void testGetEndOfYear(); - void testGetMonth(); - void testGetMonthName(); - void testGetStartOfMonth(); - void testGetEndOfMonth(); - void testGetDay(); - void testGetDayOfWeek(); - void testGetDayOfYear(); - void testGetQuarter(); - void testGetStartOfQuarter(); - void testGetEndOfQuarter(); - void testGetTime(); - void testGetHour(); - void testGetMinute(); - void testGetSecond(); - - CPPUNIT_TEST_SUITE(ScDataTransformationTest); - CPPUNIT_TEST(testColumnRemove); - CPPUNIT_TEST(testColumnSplit); - CPPUNIT_TEST(testColumnMerge); - CPPUNIT_TEST(testTextToLower); - CPPUNIT_TEST(testTextToUpper); - CPPUNIT_TEST(testTextCapitalize); - CPPUNIT_TEST(testTextTrim); - CPPUNIT_TEST(testAggregateSum); - CPPUNIT_TEST(testAggregateAverage); - CPPUNIT_TEST(testAggregateMin); - CPPUNIT_TEST(testAggregateMax); - CPPUNIT_TEST(testNumberRound); - CPPUNIT_TEST(testNumberRoundUp); - CPPUNIT_TEST(testNumberRoundDown); - CPPUNIT_TEST(testNumberAbsolute); - CPPUNIT_TEST(testNumberLogE); - CPPUNIT_TEST(testNumberLog10); - CPPUNIT_TEST(testNumberCube); - CPPUNIT_TEST(testNumberSquare); - CPPUNIT_TEST(testNumberSquareRoot); - CPPUNIT_TEST(testNumberEven); - CPPUNIT_TEST(testNumberOdd); - CPPUNIT_TEST(testNumberSign); - CPPUNIT_TEST(testReplaceNull); - CPPUNIT_TEST(testGetDateString); - CPPUNIT_TEST(testGetYear); - CPPUNIT_TEST(testGetStartOfYear); - CPPUNIT_TEST(testGetEndOfYear); - CPPUNIT_TEST(testGetMonth); - CPPUNIT_TEST(testGetMonthName); - CPPUNIT_TEST(testGetStartOfMonth); - CPPUNIT_TEST(testGetEndOfMonth); - CPPUNIT_TEST(testGetDay); - CPPUNIT_TEST(testGetDayOfWeek); - CPPUNIT_TEST(testGetDayOfYear); - CPPUNIT_TEST(testGetQuarter); - CPPUNIT_TEST(testGetStartOfQuarter); - CPPUNIT_TEST(testGetEndOfQuarter); - CPPUNIT_TEST(testGetTime); - CPPUNIT_TEST(testGetHour); - CPPUNIT_TEST(testGetMinute); - CPPUNIT_TEST(testGetSecond); - CPPUNIT_TEST_SUITE_END(); }; -void ScDataTransformationTest::testColumnRemove() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnRemove) { for (SCROW nRow = 0; nRow < 10; ++nRow) { @@ -140,7 +51,7 @@ void ScDataTransformationTest::testColumnRemove() } } -void ScDataTransformationTest::testColumnSplit() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnSplit) { m_pDoc->SetString(2, 0, 0, "Test1,Test2"); m_pDoc->SetString(2, 1, 0, "Test1,"); @@ -164,7 +75,7 @@ void ScDataTransformationTest::testColumnSplit() CPPUNIT_ASSERT_EQUAL(OUString("Test2,Test3"), m_pDoc->GetString(3, 3, 0)); } -void ScDataTransformationTest::testColumnMerge() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testColumnMerge) { m_pDoc->SetString(2, 0, 0, "Berlin"); m_pDoc->SetString(2, 1, 0, "Brussels"); @@ -190,7 +101,7 @@ void ScDataTransformationTest::testColumnMerge() } } -void ScDataTransformationTest::testTextToLower() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextToLower) { m_pDoc->SetString(2, 0, 0, "Berlin"); m_pDoc->SetString(2, 1, 0, "Brussels"); @@ -206,7 +117,7 @@ void ScDataTransformationTest::testTextToLower() CPPUNIT_ASSERT_EQUAL(OUString("peking"), m_pDoc->GetString(2, 3, 0)); } -void ScDataTransformationTest::testTextToUpper() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextToUpper) { m_pDoc->SetString(2, 0, 0, "Berlin"); m_pDoc->SetString(2, 1, 0, "Brussels"); @@ -222,7 +133,7 @@ void ScDataTransformationTest::testTextToUpper() CPPUNIT_ASSERT_EQUAL(OUString("PEKING"), m_pDoc->GetString(2, 3, 0)); } -void ScDataTransformationTest::testTextCapitalize() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextCapitalize) { m_pDoc->SetString(2, 0, 0, "hello woRlD"); m_pDoc->SetString(2, 1, 0, "qUe vA"); @@ -238,7 +149,7 @@ void ScDataTransformationTest::testTextCapitalize() CPPUNIT_ASSERT_EQUAL(OUString("Cuando Me Enamoro"), m_pDoc->GetString(2, 3, 0)); } -void ScDataTransformationTest::testTextTrim() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testTextTrim) { m_pDoc->SetString(2, 0, 0, " Berlin"); m_pDoc->SetString(2, 1, 0, "Brussels "); @@ -252,7 +163,7 @@ void ScDataTransformationTest::testTextTrim() CPPUNIT_ASSERT_EQUAL(OUString("Paris"), m_pDoc->GetString(2, 2, 0)); } -void ScDataTransformationTest::testAggregateSum() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateSum) { m_pDoc->SetValue(2, 0, 0, 2034); m_pDoc->SetValue(2, 1, 0, 2342); @@ -270,7 +181,7 @@ void ScDataTransformationTest::testAggregateSum() CPPUNIT_ASSERT_DOUBLES_EQUAL(68487.68, m_pDoc->GetValue(4, 4, 0), 1e-10); } -void ScDataTransformationTest::testAggregateAverage() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateAverage) { m_pDoc->SetValue(2, 0, 0, 2034); m_pDoc->SetValue(2, 1, 0, 2342); @@ -287,7 +198,7 @@ void ScDataTransformationTest::testAggregateAverage() CPPUNIT_ASSERT_DOUBLES_EQUAL(4, m_pDoc->GetValue(3, 3, 0), 1e-10); } -void ScDataTransformationTest::testAggregateMin() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateMin) { m_pDoc->SetValue(2, 0, 0, 2034); m_pDoc->SetValue(2, 1, 0, 2342); @@ -304,7 +215,7 @@ void ScDataTransformationTest::testAggregateMin() CPPUNIT_ASSERT_DOUBLES_EQUAL(-2342, m_pDoc->GetValue(3, 3, 0), 1e-10); } -void ScDataTransformationTest::testAggregateMax() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testAggregateMax) { m_pDoc->SetValue(2, 0, 0, 2034); m_pDoc->SetValue(2, 1, 0, 2342); @@ -323,7 +234,7 @@ void ScDataTransformationTest::testAggregateMax() CPPUNIT_ASSERT_DOUBLES_EQUAL(2034, m_pDoc->GetValue(3, 4, 0), 1e-10); } -void ScDataTransformationTest::testNumberRound() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberRound) { m_pDoc->SetValue(2, 0, 0, 2034.342453456); m_pDoc->SetValue(2, 1, 0, 2342.252678567542); @@ -339,7 +250,7 @@ void ScDataTransformationTest::testNumberRound() CPPUNIT_ASSERT_EQUAL(-453.2223, m_pDoc->GetValue(2, 3, 0)); } -void ScDataTransformationTest::testNumberRoundUp() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberRoundUp) { m_pDoc->SetValue(2, 0, 0, 2034.34); m_pDoc->SetValue(2, 1, 0, 2342.22); @@ -355,7 +266,7 @@ void ScDataTransformationTest::testNumberRoundUp() CPPUNIT_ASSERT_EQUAL(-453.0, m_pDoc->GetValue(2, 3, 0)); } -void ScDataTransformationTest::testNumberRoundDown() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberRoundDown) { m_pDoc->SetValue(2, 0, 0, 2034.34); m_pDoc->SetValue(2, 1, 0, 2342.22); @@ -371,7 +282,7 @@ void ScDataTransformationTest::testNumberRoundDown() CPPUNIT_ASSERT_EQUAL(-454.0, m_pDoc->GetValue(2, 3, 0)); } -void ScDataTransformationTest::testNumberAbsolute() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberAbsolute) { m_pDoc->SetValue(2, 0, 0, 2034.34); m_pDoc->SetValue(2, 1, 0, -2342.22); @@ -387,7 +298,7 @@ void ScDataTransformationTest::testNumberAbsolute() CPPUNIT_ASSERT_EQUAL(453.22, m_pDoc->GetValue(2, 3, 0)); } -void ScDataTransformationTest::testNumberLogE() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberLogE) { m_pDoc->SetValue(2, 0, 0, 1); m_pDoc->SetValue(2, 1, 0, 5); @@ -403,7 +314,7 @@ void ScDataTransformationTest::testNumberLogE() CPPUNIT_ASSERT_DOUBLES_EQUAL(6.21460809842, m_pDoc->GetValue(2, 3, 0), 1e-10); } -void ScDataTransformationTest::testNumberLog10() +CPPUNIT_TEST_FIXTURE(ScDataTransformationTest, testNumberLog10) { m_pDoc->SetValue(2, 0, 0, 1); m_pDoc->SetValue(2, 1, 0, 10); @@ -419,7 +330,7 @@ void ScDataTransformationTest::testNumberLog10() ... etc. - the rest is truncated