Kaydet (Commit) 31dbc51e authored tarafından hongyu zhong's avatar hongyu zhong Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for POISSON

Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-150 BUG

Change-Id: I29324659b31d98905ead88d0d0cf44361ad1df16
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 40d760db
...@@ -212,6 +212,7 @@ public: ...@@ -212,6 +212,7 @@ public:
void testMathFormulaBitRshift(); void testMathFormulaBitRshift();
void testMathFormulaBitXor(); void testMathFormulaBitXor();
void testStatisticalFormulaChiInv(); void testStatisticalFormulaChiInv();
void testStatisticalFormulaPoisson();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -355,6 +356,7 @@ public: ...@@ -355,6 +356,7 @@ public:
CPPUNIT_TEST(testMathFormulaBitRshift); CPPUNIT_TEST(testMathFormulaBitRshift);
CPPUNIT_TEST(testMathFormulaBitXor); CPPUNIT_TEST(testMathFormulaBitXor);
CPPUNIT_TEST(testStatisticalFormulaChiInv); CPPUNIT_TEST(testStatisticalFormulaChiInv);
CPPUNIT_TEST(testStatisticalFormulaPoisson);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3404,6 +3406,29 @@ void ScOpenclTest::testMathFormulaBitAnd() ...@@ -3404,6 +3406,29 @@ void ScOpenclTest::testMathFormulaBitAnd()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-150]
void ScOpenclTest::testStatisticalFormulaPoisson()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Poisson.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Poisson.", 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(3,i,0));
double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-151] //[AMLOEXT-151]
void ScOpenclTest::testStatisticalFormulaExpondist() void ScOpenclTest::testStatisticalFormulaExpondist()
{ {
......
...@@ -1444,6 +1444,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1444,6 +1444,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocBitRshift: case ocBitRshift:
case ocBitXor: case ocBitXor:
case ocChiInv: case ocChiInv:
case ocPoissonDist:
// Don't change the state. // Don't change the state.
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment