summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorhongyu zhong <hongyu@multicorewareinc.com>2013-11-10 10:32:15 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 20:30:49 -0600
commitc7d6acd37ba8ca91deb2f8de55cf44e370bc8f08 (patch)
treee83e2c58b65cce78318ca90c35a121b7874021d4 /sc/qa
parent06571f68c74b54fe2c2acbf6ae87ceaa2a8b2d8b (diff)
GPU Calc: unit test cases for CHIINV
Need to enable NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-173 BUG Change-Id: I630f4f7c994dacc601421e96290db5e2408ca569 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/ChiInv.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/ChiInv.xls b/sc/qa/unit/data/xls/opencl/statistical/ChiInv.xls
new file mode 100644
index 000000000000..9de54c1cdac5
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/ChiInv.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index ca5913c811ca..73047644de06 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -211,6 +211,7 @@ public:
void testMathFormulaBitLshift();
void testMathFormulaBitRshift();
void testMathFormulaBitXor();
+ void testStatisticalFormulaChiInv();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -353,6 +354,7 @@ public:
CPPUNIT_TEST(testMathFormulaBitLshift);
CPPUNIT_TEST(testMathFormulaBitRshift);
CPPUNIT_TEST(testMathFormulaBitXor);
+ CPPUNIT_TEST(testStatisticalFormulaChiInv);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3862,6 +3864,29 @@ void ScOpenclTest::testMathFormulaLog()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-173]
+void ScOpenclTest::testStatisticalFormulaChiInv()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/ChiInv.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ChiInv.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 10; ++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-176 ]
void ScOpenclTest::testMathCountIfsFormula()