From 52cf3dad67e7120220ea5fd5770084119fde2475 Mon Sep 17 00:00:00 2001 From: haochen Date: Fri, 25 Oct 2013 10:21:39 +0800 Subject: Testcases for NEGBINOMDIST in GPU Calc Change-Id: I19d3a98e8356600ead7d6a380159f1331c75b071 Signed-off-by: Wei Wei --- .../xls/OpenclCase/statistical/Negbinomdist.xls | Bin 0 -> 7168 bytes sc/qa/unit/opencl-test.cxx | 25 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 sc/qa/unit/data/xls/OpenclCase/statistical/Negbinomdist.xls (limited to 'sc') 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 Binary files /dev/null and b/sc/qa/unit/data/xls/OpenclCase/statistical/Negbinomdist.xls 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<DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-64] void ScOpenclTest::testFinacialDollarfrFormula() { -- cgit