summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorŁukasz Hryniuk <lukasz.hryniuk@wp.pl>2015-10-04 17:15:29 +0200
committerŁukasz Hryniuk <lukasz.hryniuk@wp.pl>2015-10-05 18:26:20 +0200
commit56d282666b5aa19d8de11b2e2288224beaf33a8b (patch)
treea7f39c0c404af3d5a04b4cb025baf7045b931c3d
parenta335cac4f55b3bc2c9e92ba8a1028010ac92218c (diff)
Performance test for SUMX2PY2
Change-Id: If7cf21e0345a1dd5a8eb0100a684c8272c7e2bce
-rw-r--r--sc/qa/perf/scperfobj.cxx26
-rw-r--r--sc/qa/perf/testdocuments/scMathFunctions2.odsbin0 -> 51370 bytes
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index 42cc0eb1a5fe..5cb11f266991 100644
--- a/sc/qa/perf/scperfobj.cxx
+++ b/sc/qa/perf/scperfobj.cxx
@@ -61,6 +61,7 @@ public:
CPPUNIT_TEST(testSum);
CPPUNIT_TEST(testFTest);
CPPUNIT_TEST(testChiTest);
+ CPPUNIT_TEST(testSumX2PY2Test);
CPPUNIT_TEST_SUITE_END();
private:
@@ -75,6 +76,7 @@ private:
void testSum();
void testFTest();
void testChiTest();
+ void testSumX2PY2Test();
};
@@ -341,6 +343,30 @@ void ScPerfObj::testChiTest()
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Wrong ChiTest result" , 0.0, xCell->getValue(), 10e-4);
}
+void ScPerfObj::testSumX2PY2Test()
+{
+ uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions2.ods"), UNO_QUERY_THROW);
+
+ CPPUNIT_ASSERT_MESSAGE("Problem in document loading" , 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(OUString::createFromAscii("SumX2PY2Sheet"));
+
+ // query for the XSpreadsheet interface
+ uno::Reference< sheet::XSpreadsheet > xSheet (rSheet, UNO_QUERY);
+ uno::Reference< table::XCell > xCell = xSheet->getCellByPosition(2, 0);
+
+ callgrindStart();
+ xCell->setFormula(OUString::createFromAscii("=SUMX2PY2(A1:A10000;B1:B10000)"));
+ xCalculatable->calculate();
+ callgrindDump("sc:sumx2py2");
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong SumX2PY2 result" , 574539.0, xCell->getValue());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScPerfObj);
}
diff --git a/sc/qa/perf/testdocuments/scMathFunctions2.ods b/sc/qa/perf/testdocuments/scMathFunctions2.ods
new file mode 100644
index 000000000000..094c3ec3480d
--- /dev/null
+++ b/sc/qa/perf/testdocuments/scMathFunctions2.ods
Binary files differ