Kaydet (Commit) 288d7f27 authored tarafından shiming zhang's avatar shiming zhang Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for CHIDIST

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-166 BUG

Change-Id: Ife835b135e7211697dc465b3dc61ed1494970632
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 4c047317
......@@ -183,6 +183,7 @@ public:
void testFinacialNPER1Formula();
void testStatisticalFormulaFDist();
void testStatisticalFormulaVar();
void testStatisticalFormulaChiDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -297,6 +298,7 @@ public:
CPPUNIT_TEST(testFinacialNPER1Formula);
CPPUNIT_TEST(testStatisticalFormulaFDist);
CPPUNIT_TEST(testStatisticalFormulaVar);
CPPUNIT_TEST(testStatisticalFormulaChiDist);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -3252,6 +3254,29 @@ void ScOpenclTest::testStatisticalFormulaGammaDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-166]
void ScOpenclTest::testStatisticalFormulaChiDist()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/ChiDist.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ChiDist.", 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();
}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -1416,6 +1416,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCotHyp:
case ocFDist:
case ocVar:
case ocChiDist:
// Don't change the state.
break;
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