summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-10-25 10:21:39 +0800
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-29 17:00:24 -0400
commit52cf3dad67e7120220ea5fd5770084119fde2475 (patch)
tree84fed983f1f7af1489f4ce3a34255702eeb4ceca /sc
parent275cca2030b2a21d87af58a8637dc81234156a5f (diff)
Testcases for NEGBINOMDIST in GPU Calc
Change-Id: I19d3a98e8356600ead7d6a380159f1331c75b071 Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/OpenclCase/statistical/Negbinomdist.xlsbin0 -> 7168 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/OpenclCase/statistical/Negbinomdist.xls b/sc/qa/unit/data/xls/OpenclCase/statistical/Negbinomdist.xls
new file mode 100644
index 000000000000..b14b8deacf62
--- /dev/null
+++ b/sc/qa/unit/data/xls/OpenclCase/statistical/Negbinomdist.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index a62a003b5835..f63660129ef1 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -84,6 +84,7 @@ public:
void testFinacialDISCFormula();
void testFinacialINTRATEFormula();
void testMathFormulaCos();
+ void testStatisticalFormulaNegbinomdist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testSharedFormulaXLSGroundWater);
@@ -115,6 +116,7 @@ public:
CPPUNIT_TEST(testFinacialDISCFormula);
CPPUNIT_TEST(testFinacialINTRATEFormula);
CPPUNIT_TEST(testMathFormulaCos);
+ CPPUNIT_TEST(testStatisticalFormulaNegbinomdist);
CPPUNIT_TEST_SUITE_END();
private:
@@ -943,6 +945,29 @@ void ScOpenclTest::testFinancialAccrintmFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-57]
+void ScOpenclTest::testStatisticalFormulaNegbinomdist()
+{
+ ScDocShellRef xDocSh = loadDoc("OpenclCase/statistical/Negbinomdist."
+ ,XLS);
+ enableOpenCL(xDocSh);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc); xDocSh->DoHardRecalc(true);
+ ScDocShellRef xDocShRes = loadDoc("OpenclCase/statistical/Negbinomdist."
+ ,XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 0; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(3,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ std::cout<<fLibre<<"\t"<<fExcel<<"\n";
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-64]
void ScOpenclTest::testFinacialDollarfrFormula()
{