[Libreoffice-commits] core.git: sc/qa
Markus Mohrhard
markus.mohrhard at googlemail.com
Sat Apr 16 12:49:32 UTC 2016
sc/qa/perf/scperfobj.cxx | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
New commits:
commit ce21baa36a703f0ea79936870c743c453b90c5b0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Apr 16 12:24:07 2016 +0200
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 at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index 12202f6..42fdd78 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);
More information about the Libreoffice-commits
mailing list