diff options
author | zhenyu yuan <zhenyuyuan@multicorewareinc.com> | 2013-11-07 15:33:40 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:40 -0600 |
commit | a26f0830913cc0acf2649b8134d383cc00b86694 (patch) | |
tree | 608c40970579d8cc299d9de3e7112ac33a21b685 | |
parent | 76af0bf451db99c0549f360f0fb3b6bf5d5ef07a (diff) |
GPU Calc: unit test cases for COTH
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-91 BUG
Change-Id: Icd18c89de26f222d0a4193a238b1b635ecc957a2
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r-- | sc/qa/unit/data/ods/opencl/math/coth.ods | bin | 0 -> 11476 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/coth.ods b/sc/qa/unit/data/ods/opencl/math/coth.ods Binary files differnew file mode 100644 index 000000000000..109e3c11448b --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/coth.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index ae56de4dc438..7e98c6f2ef38 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -179,6 +179,7 @@ public: void testMathFormulaLN(); void testMathFormulaRound(); void testMathFormulaCot(); + void testMathFormulaCoth(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -289,6 +290,7 @@ public: CPPUNIT_TEST(testMathFormulaLN); CPPUNIT_TEST(testMathFormulaRound); CPPUNIT_TEST(testMathFormulaCot); + CPPUNIT_TEST(testMathFormulaCoth); CPPUNIT_TEST_SUITE_END(); private: @@ -1736,6 +1738,29 @@ void ScOpenclTest::testMathFormulaCsc() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-91] +void ScOpenclTest::testMathFormulaCoth() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/coth.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/coth.", 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-92] void ScOpenclTest::testFinacialXNPVFormula() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index c2ba6940f4cc..f846c5e43442 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1413,6 +1413,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocLn: case ocRound: case ocCot: + case ocCotHyp: // Don't change the state. break; default: |