summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-11-12 16:54:51 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:31 -0600
commit0b199159169d02dfa31df271932e02404de94899 (patch)
tree62a5f3fe314e24e3d658df74e10c6ff086d5e856 /sc/qa/unit
parent2354714c542666d96d080e28ea293db016aaad58 (diff)
GPU Calc: unit test cases for HYPGEOMDIST
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-199 BUG Change-Id: Ibad56aaa79c705e39b0ccad7a6b72955feeb4b4c Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/HypGeomDist.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/HypGeomDist.xls b/sc/qa/unit/data/xls/opencl/statistical/HypGeomDist.xls
new file mode 100644
index 000000000000..551cf248c79e
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/HypGeomDist.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index f5295badb11a..7afe2d52032e 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -229,6 +229,7 @@ public:
void testMathFormulaRandom();
void testMathFormulaConvert();
void testMathFormulaProduct();
+ void testStatisticalFormulaHypGeomDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -389,6 +390,7 @@ public:
CPPUNIT_TEST(testMathFormulaRandom);
CPPUNIT_TEST(testMathFormulaConvert);
CPPUNIT_TEST(testMathFormulaProduct);
+ CPPUNIT_TEST(testStatisticalFormulaHypGeomDist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4437,6 +4439,29 @@ void ScOpenclTest::testMathFormulaKombin()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-199]
+void ScOpenclTest::testStatisticalFormulaHypGeomDist()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/HypGeomDist.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/HypGeomDist.", 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(4,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{