diff options
author | Łukasz Hryniuk <lukasz.hryniuk@wp.pl> | 2015-10-04 17:17:17 +0200 |
---|---|---|
committer | Łukasz Hryniuk <lukasz.hryniuk@wp.pl> | 2015-10-05 18:26:20 +0200 |
commit | 46717d374f972cd5bf8e7e21614ebe3613060738 (patch) | |
tree | 99224502191aec5caa0cc446213324b0c0427c1e /sc | |
parent | 56d282666b5aa19d8de11b2e2288224beaf33a8b (diff) |
Performance test for TTEST
Change-Id: I05e34b24ed074a9f33d2a860f9042c85d7b556bc
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/perf/scperfobj.cxx | 26 | ||||
-rw-r--r-- | sc/qa/perf/testdocuments/scMathFunctions2.ods | bin | 51370 -> 348797 bytes |
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx index 5cb11f266991..e2539b273175 100644 --- a/sc/qa/perf/scperfobj.cxx +++ b/sc/qa/perf/scperfobj.cxx @@ -62,6 +62,7 @@ public: CPPUNIT_TEST(testFTest); CPPUNIT_TEST(testChiTest); CPPUNIT_TEST(testSumX2PY2Test); + CPPUNIT_TEST(testTTest); CPPUNIT_TEST_SUITE_END(); private: @@ -77,6 +78,7 @@ private: void testFTest(); void testChiTest(); void testSumX2PY2Test(); + void testTTest(); }; @@ -367,6 +369,30 @@ void ScPerfObj::testSumX2PY2Test() CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong SumX2PY2 result" , 574539.0, xCell->getValue()); } +void ScPerfObj::testTTest() +{ + 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("TTestSheet")); + + // query for the XSpreadsheet interface + uno::Reference< sheet::XSpreadsheet > xSheet (rSheet, UNO_QUERY); + uno::Reference< table::XCell > xCell = xSheet->getCellByPosition(0, 0); + + callgrindStart(); + xCell->setFormula(OUString::createFromAscii("=T.TEST(B1:CV100;CW1:GQ100;2;1)")); + xCalculatable->calculate(); + callgrindDump("sc:ttest"); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong TTest result" , 0.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 differindex 094c3ec3480d..8dbc1b9c100d 100644 --- a/sc/qa/perf/testdocuments/scMathFunctions2.ods +++ b/sc/qa/perf/testdocuments/scMathFunctions2.ods |