summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 7ebbb27db569..76cf866cc6a1 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -186,6 +186,7 @@ public:
void testStatisticalFormulaChiDist();
void testMathFormulaPower();
void testMathFormulaOdd();
+ void testStatisticalFormulaChiSqDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -303,6 +304,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaChiDist);
CPPUNIT_TEST(testMathFormulaPower);
CPPUNIT_TEST(testMathFormulaOdd);
+ CPPUNIT_TEST(testStatisticalFormulaChiSqDist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2965,6 +2967,35 @@ void ScOpenclTest:: testFinancialXirrFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-139]
+void ScOpenclTest::testStatisticalFormulaChiSqDist()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/CHISQDIST.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CHISQDIST.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(2,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ for (SCROW i = 1; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(3,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-140]
void ScOpenclTest::testStatisticalFormulaConfidence()
{