summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-11-09 11:04:24 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:47 -0600
commit649fa80a1120f09aefe099b2cb2efbbdca8199ed (patch)
tree69ef9212aee179f13d38bc0c0c536e7d421320a2
parent6c006e1c661ba011aa2bb2c9fe753cab85b5b366 (diff)
GPU Calc: unit test cases for FINV
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-159 BUG Change-Id: Id792605d06530087c13d939495cfc8bbf617c625 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/FInv.xlsbin0 -> 8704 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx29
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/FInv.xls b/sc/qa/unit/data/xls/opencl/statistical/FInv.xls
new file mode 100644
index 000000000000..c569f5f8f490
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/FInv.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index e754f172f06c..444f8533fd1f 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -190,6 +190,7 @@ public:
void testStatisticalFormulaChiSqInv();
void testStatisticalFormulaGammaInv();
void testMathFormulaFloor();
+ void testStatisticalFormulaFInv();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -311,6 +312,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaChiSqInv);
CPPUNIT_TEST(testStatisticalFormulaGammaInv);
CPPUNIT_TEST(testMathFormulaFloor);
+ CPPUNIT_TEST(testStatisticalFormulaFInv);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3389,6 +3391,33 @@ void ScOpenclTest::testStatisticalFormulaGammaInv()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-159]
+void ScOpenclTest::testStatisticalFormulaFInv()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/FInv.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/FInv.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 19; ++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));
+ fLibre = pDoc->GetValue(ScAddress(4,i,0));
+ fExcel = pDocRes->GetValue(ScAddress(4,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 3100595bc49c..165b2f0485ca 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1423,6 +1423,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocChiSqInv:
case ocGammaInv:
case ocFloor:
+ case ocFInv:
// Don't change the state.
break;
default: