summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/ChiDist.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/ChiDist.xls b/sc/qa/unit/data/xls/opencl/statistical/ChiDist.xls
new file mode 100644
index 000000000000..4fcbecb3b298
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/ChiDist.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index e48bceb084ef..e6344aee6f29 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -183,6 +183,7 @@ public:
void testFinacialNPER1Formula();
void testStatisticalFormulaFDist();
void testStatisticalFormulaVar();
+ void testStatisticalFormulaChiDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -297,6 +298,7 @@ public:
CPPUNIT_TEST(testFinacialNPER1Formula);
CPPUNIT_TEST(testStatisticalFormulaFDist);
CPPUNIT_TEST(testStatisticalFormulaVar);
+ CPPUNIT_TEST(testStatisticalFormulaChiDist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3252,6 +3254,29 @@ void ScOpenclTest::testStatisticalFormulaGammaDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-166]
+void ScOpenclTest::testStatisticalFormulaChiDist()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/ChiDist.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ChiDist.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 19; ++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();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{