summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-11-09 11:19:35 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:47 -0600
commitb9e443d58d0f915b8dacd7466c2072c270af401a (patch)
treeb1459b3e7b87cd79cbe3ef70fed16bb8b5a04a11
parentc07c6bde40da1c7817b7bfcb1e888e8b561a184c (diff)
GPU Calc: unit test cases for FTEST
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-160 BUG Change-Id: I248b3e71e16abe04585abfc7736c02786b2b871a 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/FTest.xlsbin0 -> 8192 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx26
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/FTest.xls b/sc/qa/unit/data/xls/opencl/statistical/FTest.xls
new file mode 100644
index 000000000000..088cb6d96858
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/FTest.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 444f8533fd1f..b597ed081dc1 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -191,6 +191,7 @@ public:
void testStatisticalFormulaGammaInv();
void testMathFormulaFloor();
void testStatisticalFormulaFInv();
+ void testStatisticalFormulaFTest();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -313,6 +314,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaGammaInv);
CPPUNIT_TEST(testMathFormulaFloor);
CPPUNIT_TEST(testStatisticalFormulaFInv);
+ CPPUNIT_TEST(testStatisticalFormulaFTest);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3418,6 +3420,30 @@ void ScOpenclTest::testStatisticalFormulaFInv()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-160]
+void ScOpenclTest::testStatisticalFormulaFTest()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/FTest.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/FTest.", 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(2,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(2,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 165b2f0485ca..c0bb7fdbd97d 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1424,6 +1424,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocGammaInv:
case ocFloor:
case ocFInv:
+ case ocFTest:
// Don't change the state.
break;
default: