summaryrefslogtreecommitdiff
path: root/sc/qa/perf
diff options
context:
space:
mode:
authorŁukasz Hryniuk <lukasz.hryniuk@wp.pl>2015-09-25 17:44:19 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-25 17:33:12 +0000
commitd75406593d993724f266aae4f219aa7ca1e84b57 (patch)
tree4d596249c22e9527f8dfac67fcfd1ade24a1cf03 /sc/qa/perf
parentdfb00ac6ee43e008cc46c71546ba4af64d3a0bbd (diff)
Performance test for ChiTest
Change-Id: I9176d46c627fa1aba043f5d0e3d8fd74431fa4b5 Reviewed-on: https://gerrit.libreoffice.org/18873 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/qa/perf')
-rw-r--r--sc/qa/perf/scperfobj.cxx26
-rw-r--r--sc/qa/perf/testdocuments/scMathFunctions.odsbin46108 -> 307460 bytes
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index 310c004ca675..42cc0eb1a5fe 100644
--- a/sc/qa/perf/scperfobj.cxx
+++ b/sc/qa/perf/scperfobj.cxx
@@ -60,6 +60,7 @@ public:
CPPUNIT_TEST(testSheets);
CPPUNIT_TEST(testSum);
CPPUNIT_TEST(testFTest);
+ CPPUNIT_TEST(testChiTest);
CPPUNIT_TEST_SUITE_END();
private:
@@ -73,6 +74,7 @@ private:
void testSheets();
void testSum();
void testFTest();
+ void testChiTest();
};
@@ -315,6 +317,30 @@ void ScPerfObj::testFTest()
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Wrong FTest result" , 0.8909, xCell->getValue(), 10e-4);
}
+void ScPerfObj::testChiTest()
+{
+ uno::Reference< sheet::XSpreadsheetDocument > xDoc(init("scMathFunctions.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("ChiTestSheet"));
+
+ // 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("=CHITEST(B1:CV100;CW1:GQ100)"));
+ xCalculatable->calculate();
+ callgrindDump("sc:chitest");
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Wrong ChiTest result" , 0.0, xCell->getValue(), 10e-4);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScPerfObj);
}
diff --git a/sc/qa/perf/testdocuments/scMathFunctions.ods b/sc/qa/perf/testdocuments/scMathFunctions.ods
index b80f8f6c19a0..2e748074b712 100644
--- a/sc/qa/perf/testdocuments/scMathFunctions.ods
+++ b/sc/qa/perf/testdocuments/scMathFunctions.ods
Binary files differ