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

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: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 9d450002
...@@ -216,6 +216,7 @@ public: ...@@ -216,6 +216,7 @@ public:
void testMathFormulaSumSQ(); void testMathFormulaSumSQ();
void testStatisticalFormulaSkewp(); void testStatisticalFormulaSkewp();
void testMathFormulaSqrtPi(); void testMathFormulaSqrtPi();
void testStatisticalFormulaBinomDist();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -363,6 +364,7 @@ public: ...@@ -363,6 +364,7 @@ public:
CPPUNIT_TEST(testMathFormulaSumSQ); CPPUNIT_TEST(testMathFormulaSumSQ);
CPPUNIT_TEST(testStatisticalFormulaSkewp); CPPUNIT_TEST(testStatisticalFormulaSkewp);
CPPUNIT_TEST(testMathFormulaSqrtPi); CPPUNIT_TEST(testMathFormulaSqrtPi);
CPPUNIT_TEST(testStatisticalFormulaBinomDist);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -4101,6 +4103,29 @@ void ScOpenclTest::testMathFormulaSqrtPi() ...@@ -4101,6 +4103,29 @@ void ScOpenclTest::testMathFormulaSqrtPi()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->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() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -1448,6 +1448,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1448,6 +1448,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocPoissonDist: case ocPoissonDist:
case ocSumSQ: case ocSumSQ:
case ocSkewp: case ocSkewp:
case ocBinomDist:
// 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