diff options
Diffstat (limited to 'sc/qa/perf')
-rw-r--r-- | sc/qa/perf/scperfobj.cxx | 26 | ||||
-rw-r--r-- | sc/qa/perf/testdocuments/scMathFunctions2.ods | bin | 0 -> 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 Binary files differnew file mode 100644 index 000000000000..094c3ec3480d --- /dev/null +++ b/sc/qa/perf/testdocuments/scMathFunctions2.ods |