Kaydet (Commit) 52a17171 authored tarafından mingli's avatar mingli Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for BETADIST

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-162 BUG

Change-Id: I7d0300030d7518d20dd7b890dc665e9b56ba5c8d
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 8d7b2d96
...@@ -193,6 +193,7 @@ public: ...@@ -193,6 +193,7 @@ public:
void testStatisticalFormulaFInv(); void testStatisticalFormulaFInv();
void testStatisticalFormulaFTest(); void testStatisticalFormulaFTest();
void testStatisticalFormulaB(); void testStatisticalFormulaB();
void testStatisticalFormulaBetaDist();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -317,6 +318,7 @@ public: ...@@ -317,6 +318,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaFInv); CPPUNIT_TEST(testStatisticalFormulaFInv);
CPPUNIT_TEST(testStatisticalFormulaFTest); CPPUNIT_TEST(testStatisticalFormulaFTest);
CPPUNIT_TEST(testStatisticalFormulaB); CPPUNIT_TEST(testStatisticalFormulaB);
CPPUNIT_TEST(testStatisticalFormulaBetaDist);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3472,6 +3474,32 @@ void ScOpenclTest::testStatisticalFormulaB() ...@@ -3472,6 +3474,32 @@ void ScOpenclTest::testStatisticalFormulaB()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-162]
void ScOpenclTest::testStatisticalFormulaBetaDist()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/BetaDist.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/BetaDist.", ODS);
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(6,i,0));
double fExcel = pDocRes->GetValue(ScAddress(6,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
fLibre = pDoc->GetValue(ScAddress(7,i,0));
fExcel = pDocRes->GetValue(ScAddress(7,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-166] //[AMLOEXT-166]
void ScOpenclTest::testStatisticalFormulaChiDist() void ScOpenclTest::testStatisticalFormulaChiDist()
{ {
......
...@@ -1426,6 +1426,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1426,6 +1426,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocFInv: case ocFInv:
case ocFTest: case ocFTest:
case ocB: case ocB:
case ocBetaDist:
// 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