[Libreoffice-commits] core.git: 2 commits - sc/qa
Markus Mohrhard
markus.mohrhard at googlemail.com
Fri Apr 15 17:17:52 UTC 2016
sc/qa/perf/scperfobj.cxx | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
New commits:
commit e3e9e0ae125cef1cdce149ce632c21c481be8654
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 15 19:14:32 2016 +0200
add test for tdf#88849
Change-Id: Id72d94799e20f0b290d5d5b05fb2b351d0750178
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index decce7f..12202f6 100644
--- a/sc/qa/perf/scperfobj.cxx
+++ b/sc/qa/perf/scperfobj.cxx
@@ -74,6 +74,7 @@ public:
CPPUNIT_TEST(testLoadingFileWithSingleBigSheet);
CPPUNIT_TEST(testFixedSum);
CPPUNIT_TEST(testVariableSum);
+ CPPUNIT_TEST(testMatConcat);
CPPUNIT_TEST_SUITE_END();
private:
@@ -98,6 +99,7 @@ private:
void testLoadingFileWithSingleBigSheet();
void testFixedSum();
void testVariableSum();
+ void testMatConcat();
};
sal_Int32 ScPerfObj::nTest = 0;
@@ -628,6 +630,34 @@ void ScPerfObj::testVariableSum()
callgrindDump("sc:sum_with_variable_array_formula");
}
+void ScPerfObj::testMatConcat()
+{
+ 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("=A:A&B:B");
+ xCalculatable->calculate();
+ callgrindDump("sc:mat_concat");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScPerfObj);
}
commit 3d9f86e96874b238b4b960b65f1f10a1dc6ef881
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 15 19:14:11 2016 +0200
fix calc perfcheck build
Change-Id: Ied1ca0c9c3e2c7cd34c4d21e27a95df21ab80bf9
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index 74b2c6a..decce7f 100644
--- a/sc/qa/perf/scperfobj.cxx
+++ b/sc/qa/perf/scperfobj.cxx
@@ -596,7 +596,7 @@ void ScPerfObj::testFixedSum()
for( sal_Int32 i = 0; i < 1000; ++i )
{
uno::Reference< table::XCell > xCell = xSheet->getCellByPosition(1, i);
- ASSERT_DOUBLES_EQUAL(50206.0, xCell->getValue());
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(50206.0, xCell->getValue(), 1e-12);
}
}
More information about the Libreoffice-commits
mailing list