summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-11-07 16:11:06 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:41 -0600
commitd215c3627c2e92cda7f4e0c5a23b04901a0a2946 (patch)
treeaa236ffa48f2be99560d245c82df2511abc8319e
parent8f278eabf05e6911989ea6bacfe5b785123b3ac4 (diff)
GPU Calc: unit test cases for FDIST
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-141 BUG Change-Id: I204d3f5229294e16852721f3b4a6a715bf11afd8 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/Fdist.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/Fdist.xls b/sc/qa/unit/data/xls/opencl/statistical/Fdist.xls
new file mode 100644
index 000000000000..16ab18f822a1
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/Fdist.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 56b48460a0bb..12e3ba8e8d68 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -181,6 +181,7 @@ public:
void testMathFormulaCot();
void testMathFormulaCoth();
void testFinacialNPER1Formula();
+ void testStatisticalFormulaFDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -293,6 +294,7 @@ public:
CPPUNIT_TEST(testMathFormulaCot);
CPPUNIT_TEST(testMathFormulaCoth);
CPPUNIT_TEST(testFinacialNPER1Formula);
+ CPPUNIT_TEST(testStatisticalFormulaFDist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2933,6 +2935,29 @@ void ScOpenclTest::testStatisticalFormulaConfidence()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-141]
+void ScOpenclTest::testStatisticalFormulaFDist()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/Fdist.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Fdist.", 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-136]
void ScOpenclTest::testFinancialCoupncdFormula()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f846c5e43442..2cd7c538b27b 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1414,6 +1414,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocRound:
case ocCot:
case ocCotHyp:
+ case ocFDist:
// Don't change the state.
break;
default: