diff options
-rw-r--r-- | sc/qa/unit/data/ods/opencl/math/sech.ods | bin | 0 -> 12092 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/sech.ods b/sc/qa/unit/data/ods/opencl/math/sech.ods Binary files differnew file mode 100644 index 000000000000..a50c2e974fbe --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/sech.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b1dc898b2606..293a6fe721e7 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -278,6 +278,7 @@ public: void testStatisticalFormulaStDevA(); void testStatisticalFormulaStDevPA(); void testMathFormulaSEC(); + void testMathFormulaSECH(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -486,6 +487,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaStDevA); CPPUNIT_TEST(testStatisticalFormulaStDevPA); CPPUNIT_TEST(testMathFormulaSEC); + CPPUNIT_TEST(testMathFormulaSECH); CPPUNIT_TEST_SUITE_END(); private: @@ -5736,6 +5738,29 @@ void ScOpenclTest::testMathFormulaSEC() xDocSh->DoClose(); xDocShRes->DoClose(); } +//AMLOEXT-368 +void ScOpenclTest::testMathFormulaSECH() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/sech.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/sech.", 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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 4db7144fd05c..a7b95e5fbda4 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1503,6 +1503,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocStDevA: case ocStDevPA: case ocSecant: + case ocSecantHyp: // Don't change the state. break; default: |