diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-16 12:24:07 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-04-16 12:49:10 +0000 |
commit | ce21baa36a703f0ea79936870c743c453b90c5b0 (patch) | |
tree | 74033eff3e07800107b56b0b567157cd0f0f8006 | |
parent | 92f12d0dd707a1d89f710832ae253b7ca05a1fe6 (diff) |
add test case for smaller MatConcat case, related tdf#88849
Change-Id: I8faf836e87ae371a156e07ec7a5bc274ccf32efd
Reviewed-on: https://gerrit.libreoffice.org/24124
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/qa/perf/scperfobj.cxx | 36 |
1 files changed, 33 insertions, 3 deletions
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); |