summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorhongyu zhong <hongyu@multicorewareinc.com>2013-11-11 16:30:22 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:24 -0600
commita30a12b1cc81441a7e490465ec5ad4ab070a661d (patch)
treed6729bdfaf36ac463b7d83275dff1d11ae0b3bf6 /sc/qa
parent9d45000281e10b724f3a88ca95ee2c68c09bd736 (diff)
GPU Calc: unit test cases for BINOMDIST
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-192 BUG Change-Id: If6fad4b811f46f88895c6c841cc9754244968728 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/BinomDist.xlsbin0 -> 8192 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/BinomDist.xls b/sc/qa/unit/data/xls/opencl/statistical/BinomDist.xls
new file mode 100644
index 000000000000..09c712be851c
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/BinomDist.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index b00d1e299b55..8a4eaf94d04c 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -216,6 +216,7 @@ public:
void testMathFormulaSumSQ();
void testStatisticalFormulaSkewp();
void testMathFormulaSqrtPi();
+ void testStatisticalFormulaBinomDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -363,6 +364,7 @@ public:
CPPUNIT_TEST(testMathFormulaSumSQ);
CPPUNIT_TEST(testStatisticalFormulaSkewp);
CPPUNIT_TEST(testMathFormulaSqrtPi);
+ CPPUNIT_TEST(testStatisticalFormulaBinomDist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4101,6 +4103,29 @@ void ScOpenclTest::testMathFormulaSqrtPi()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-192]
+void ScOpenclTest::testStatisticalFormulaBinomDist()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/BinomDist.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/BinomDist.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{