diff options
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 894933f26ff6..ae56de4dc438 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -178,6 +178,7 @@ public: void testStatisticalFormulaGammaDist(); void testMathFormulaLN(); void testMathFormulaRound(); + void testMathFormulaCot(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -287,6 +288,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaGammaDist); CPPUNIT_TEST(testMathFormulaLN); CPPUNIT_TEST(testMathFormulaRound); + CPPUNIT_TEST(testMathFormulaCot); CPPUNIT_TEST_SUITE_END(); private: @@ -1689,6 +1691,29 @@ void ScOpenclTest::testStatisticalFormulaKurt() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-88] +void ScOpenclTest::testMathFormulaCot() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/cot.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/cot.", ODS); + 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-90] void ScOpenclTest::testMathFormulaCsc() { |