summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-11-09 13:24:10 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:50 -0600
commit1a0370b48d20ed16c7c33d058482cec7427e8868 (patch)
tree160b4a630496c858e8158d0a3d7244a9f81600a4
parentdb9432fbcf497e4961184ade7ca81784f1501dff (diff)
GPU Calc: unit test cases for EXPONDIST
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-151BUG Change-Id: Iaee4276e29ff469e5527e678fdf296a11af173a1 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/Expondist.xlsbin0 -> 6656 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/Expondist.xls b/sc/qa/unit/data/xls/opencl/statistical/Expondist.xls
new file mode 100644
index 000000000000..63efa27418c0
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/Expondist.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index d287fd14383f..58f832118538 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -197,6 +197,7 @@ public:
void testMathFormulaCscH();
void testMathFormulaExp();
void testMathFormulaLog10();
+ void testStatisticalFormulaExpondist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -325,6 +326,7 @@ public:
CPPUNIT_TEST(testMathFormulaCscH);
CPPUNIT_TEST(testMathFormulaExp);
CPPUNIT_TEST(testMathFormulaLog10);
+ CPPUNIT_TEST(testStatisticalFormulaExpondist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3300,6 +3302,29 @@ void ScOpenclTest::testMathFormulaBitAnd()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-151]
+void ScOpenclTest::testStatisticalFormulaExpondist()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/Expondist.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Expondist.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 0; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(3,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-153]
void ScOpenclTest::testMathFormulaOdd()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index fa4b85612e25..3539a4f4c7b1 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1429,6 +1429,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocBetaDist:
case ocExp:
case ocLog10:
+ case ocExpDist:
// Don't change the state.
break;
default: