sc/qa/perf/scperfobj.cxx                     |   26 ++++++++++++++++++++++++++
 sc/qa/perf/testdocuments/scMathFunctions.ods |binary
 2 files changed, 26 insertions(+)

New commits:
commit d75406593d993724f266aae4f219aa7ca1e84b57
Author: Łukasz Hryniuk <lukasz.hryn...@wp.pl>
Date:   Fri Sep 25 17:44:19 2015 +0200

    Performance test for ChiTest
    
    Change-Id: I9176d46c627fa1aba043f5d0e3d8fd74431fa4b5
    Reviewed-on: https://gerrit.libreoffice.org/18873
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/qa/perf/scperfobj.cxx b/sc/qa/perf/scperfobj.cxx
index 310c004..42cc0eb 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 b80f8f6..2e74807 100644
Binary files a/sc/qa/perf/testdocuments/scMathFunctions.ods and 
b/sc/qa/perf/testdocuments/scMathFunctions.ods differ
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to