diff options
author | zhenyu yuan <zhenyuyuan@multicorewareinc.com> | 2013-11-07 15:20:14 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:40 -0600 |
commit | e4be59b2b15cd6a52a7833e12fe3af8ba9f8330c (patch) | |
tree | 4aec9c7f2ff8c56b609529d5ca583dec441a1ca0 | |
parent | 425f1f554620e39c4707fa149b3d04bff7354222 (diff) |
GPU Calc: unit test cases for COT
Need turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-88 BUG
Change-Id: Ica73415215042a5c2dd55df16498420576772ba1
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/cot.ods | bin | 0 -> 11689 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/cot.ods b/sc/qa/unit/data/ods/opencl/math/cot.ods Binary files differnew file mode 100644 index 000000000000..b365efd1772f --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/cot.ods 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() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b3027573abc2..c2ba6940f4cc 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1412,6 +1412,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocGammaDist: case ocLn: case ocRound: + case ocCot: // Don't change the state. break; default: |