diff options
author | tianyao <tianyao@multicorewareinc.com> | 2013-11-09 12:35:40 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:50 -0600 |
commit | b825d6fd83e6eadd732b930c0aae01f9c50abed8 (patch) | |
tree | 356c412e3c21172f5b64e0b1d906525a189e21c2 | |
parent | 3fa3072bfaeeae1145967432a7d809a0925dd064 (diff) |
GPU Calc: unit test cases for LOG10
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-180 BUG
Change-Id: Ie52bc244f40df8624c49a3a31406cb5be5f04ac4
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/log10.ods | bin | 0 -> 11916 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/log10.ods b/sc/qa/unit/data/ods/opencl/math/log10.ods Binary files differnew file mode 100644 index 000000000000..12058daa9247 --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/log10.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index af6c512270f6..d287fd14383f 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -196,6 +196,7 @@ public: void testStatisticalFormulaBetaDist(); void testMathFormulaCscH(); void testMathFormulaExp(); + void testMathFormulaLog10(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -323,6 +324,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaBetaDist); CPPUNIT_TEST(testMathFormulaCscH); CPPUNIT_TEST(testMathFormulaExp); + CPPUNIT_TEST(testMathFormulaLog10); CPPUNIT_TEST_SUITE_END(); private: @@ -3593,6 +3595,28 @@ void ScOpenclTest::testMathFormulaFloor() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-180] +void ScOpenclTest::testMathFormulaLog10() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/log10.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/log10.", 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 7762eb8d9664..fa4b85612e25 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1428,6 +1428,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocB: case ocBetaDist: case ocExp: + case ocLog10: // Don't change the state. break; default: |