From ce21baa36a703f0ea79936870c743c453b90c5b0 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sat, 16 Apr 2016 12:24:07 +0200 Subject: add test case for smaller MatConcat case, related tdf#88849 Change-Id: I8faf836e87ae371a156e07ec7a5bc274ccf32efd Reviewed-on: https://gerrit.libreoffice.org/24124 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- sc/qa/perf/scperfobj.cxx | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'sc/qa') diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx index 12202f6e3471..42fdd78fd593 100644 --- a/sc/qa/perf/scperfobj.cxx +++ b/sc/qa/perf/scperfobj.cxx @@ -74,7 +74,8 @@ public: CPPUNIT_TEST(testLoadingFileWithSingleBigSheet); CPPUNIT_TEST(testFixedSum); CPPUNIT_TEST(testVariableSum); - CPPUNIT_TEST(testMatConcat); + CPPUNIT_TEST(testMatConcatSmall); + CPPUNIT_TEST(testMatConcatLarge); CPPUNIT_TEST_SUITE_END(); private: @@ -99,7 +100,8 @@ private: void testLoadingFileWithSingleBigSheet(); void testFixedSum(); void testVariableSum(); - void testMatConcat(); + void testMatConcatSmall(); + void testMatConcatLarge(); }; sal_Int32 ScPerfObj::nTest = 0; @@ -630,7 +632,35 @@ void ScPerfObj::testVariableSum() callgrindDump("sc:sum_with_variable_array_formula"); } -void ScPerfObj::testMatConcat() +void ScPerfObj::testMatConcatSmall() +{ + uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("empty.ods"), UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xDoc.is()); + uno::Reference< sheet::XCalculatable > xCalculatable(xDoc, UNO_QUERY_THROW); + + // get getSheets + uno::Reference< sheet::XSpreadsheets > xSheets (xDoc->getSheets(), UNO_QUERY_THROW); + + uno::Any rSheet = xSheets->getByName("Sheet1"); + + // query for the XSpreadsheet interface + uno::Reference< sheet::XSpreadsheet > xSheet (rSheet, UNO_QUERY); + + // query for the XCellRange interface + uno::Reference< table::XCellRange > rCellRange(rSheet, UNO_QUERY); + // query the cell range + uno::Reference< table::XCellRange > xCellRange = rCellRange->getCellRangeByName("C1"); + + uno::Reference< sheet::XArrayFormulaRange > xArrayFormulaRange(xCellRange, UNO_QUERY_THROW); + + callgrindStart(); + xArrayFormulaRange->setArrayFormula("=A1:A20&B1:B20"); + xCalculatable->calculate(); + callgrindDump("sc:mat_concat_small"); +} + +void ScPerfObj::testMatConcatLarge() { uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("empty.ods"), UNO_QUERY_THROW); -- cgit