diff options
author | tianyao <tianyao@multicorewareinc.com> | 2013-11-09 12:19:24 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:49 -0600 |
commit | 349d7cf756967abb5a29f2f891961cc0911f7666 (patch) | |
tree | 0d96f8a0db372eaeb351a7a67fb34cee0dac4e1a /sc/qa/unit/opencl-test.cxx | |
parent | 7ccd1f328b95a42f2b6d9ea43c6b8bf4aaa25233 (diff) |
GPU Calc: unit test cases for EXP
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-165 BUG
Change-Id: If3661eaa7938d383c239a5978f748015d6f021a4
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
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 3412552316a6..af6c512270f6 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -195,6 +195,7 @@ public: void testStatisticalFormulaB(); void testStatisticalFormulaBetaDist(); void testMathFormulaCscH(); + void testMathFormulaExp(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -321,6 +322,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaB); CPPUNIT_TEST(testStatisticalFormulaBetaDist); CPPUNIT_TEST(testMathFormulaCscH); + CPPUNIT_TEST(testMathFormulaExp); CPPUNIT_TEST_SUITE_END(); private: @@ -3524,6 +3526,28 @@ void ScOpenclTest::testStatisticalFormulaBetaDist() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-165] +void ScOpenclTest::testMathFormulaExp() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/exp.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/exp.", 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-166] void ScOpenclTest::testStatisticalFormulaChiDist() { |