diff options
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/BinomDist.xls | bin | 0 -> 8192 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/BinomDist.xls b/sc/qa/unit/data/xls/opencl/statistical/BinomDist.xls Binary files differnew file mode 100644 index 000000000000..09c712be851c --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/BinomDist.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b00d1e299b55..8a4eaf94d04c 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -216,6 +216,7 @@ public: void testMathFormulaSumSQ(); void testStatisticalFormulaSkewp(); void testMathFormulaSqrtPi(); + void testStatisticalFormulaBinomDist(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -363,6 +364,7 @@ public: CPPUNIT_TEST(testMathFormulaSumSQ); CPPUNIT_TEST(testStatisticalFormulaSkewp); CPPUNIT_TEST(testMathFormulaSqrtPi); + CPPUNIT_TEST(testStatisticalFormulaBinomDist); CPPUNIT_TEST_SUITE_END(); private: @@ -4101,6 +4103,29 @@ void ScOpenclTest::testMathFormulaSqrtPi() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-192] +void ScOpenclTest::testStatisticalFormulaBinomDist() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/statistical/BinomDist.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/BinomDist.", XLS); + 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(1,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(1,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |