diff options
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b5427bb78bbc..7ebbb27db569 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -185,6 +185,7 @@ public: void testStatisticalFormulaVar(); void testStatisticalFormulaChiDist(); void testMathFormulaPower(); + void testMathFormulaOdd(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -301,6 +302,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaVar); CPPUNIT_TEST(testStatisticalFormulaChiDist); CPPUNIT_TEST(testMathFormulaPower); + CPPUNIT_TEST(testMathFormulaOdd); CPPUNIT_TEST_SUITE_END(); private: @@ -3202,6 +3204,28 @@ void ScOpenclTest::testMathFormulaBitAnd() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-153] +void ScOpenclTest::testMathFormulaOdd() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/odd.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/odd.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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(); +} //[AMLOEXT-154] void ScOpenclTest::testMathFormulaLN() { |