summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortianyao <tianyao@multicorewareinc.com>2013-11-09 12:19:24 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:49 -0600
commit349d7cf756967abb5a29f2f891961cc0911f7666 (patch)
tree0d96f8a0db372eaeb351a7a67fb34cee0dac4e1a
parent7ccd1f328b95a42f2b6d9ea43c6b8bf4aaa25233 (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>
-rw-r--r--sc/qa/unit/data/ods/opencl/math/exp.odsbin0 -> 11879 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/exp.ods b/sc/qa/unit/data/ods/opencl/math/exp.ods
new file mode 100644
index 000000000000..2710fb8101c7
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/exp.ods
Binary files differ
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()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 6e1a6063301a..7762eb8d9664 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1427,6 +1427,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocFTest:
case ocB:
case ocBetaDist:
+ case ocExp:
// Don't change the state.
break;
default: