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

GPU Calc: unit test cases for GAMMAINV

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-158 BUG

Change-Id: Ia759d5fda3c96aafb51cd8bd7d6a9789b5fc149d
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst e3ae4a6d
...@@ -188,6 +188,7 @@ public: ...@@ -188,6 +188,7 @@ public:
void testMathFormulaOdd(); void testMathFormulaOdd();
void testStatisticalFormulaChiSqDist(); void testStatisticalFormulaChiSqDist();
void testStatisticalFormulaChiSqInv(); void testStatisticalFormulaChiSqInv();
void testStatisticalFormulaGammaInv();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -307,6 +308,7 @@ public: ...@@ -307,6 +308,7 @@ public:
CPPUNIT_TEST(testMathFormulaOdd); CPPUNIT_TEST(testMathFormulaOdd);
CPPUNIT_TEST(testStatisticalFormulaChiSqDist); CPPUNIT_TEST(testStatisticalFormulaChiSqDist);
CPPUNIT_TEST(testStatisticalFormulaChiSqInv); CPPUNIT_TEST(testStatisticalFormulaChiSqInv);
CPPUNIT_TEST(testStatisticalFormulaGammaInv);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3358,6 +3360,33 @@ void ScOpenclTest::testStatisticalFormulaGammaDist() ...@@ -3358,6 +3360,33 @@ void ScOpenclTest::testStatisticalFormulaGammaDist()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-158]
void ScOpenclTest::testStatisticalFormulaGammaInv()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/GammaInv.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/GammaInv.", 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));
fLibre = pDoc->GetValue(ScAddress(4,i,0));
fExcel = pDocRes->GetValue(ScAddress(4,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()
{ {
......
...@@ -1421,6 +1421,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1421,6 +1421,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocOdd: case ocOdd:
case ocChiSqDist: case ocChiSqDist:
case ocChiSqInv: case ocChiSqInv:
case ocGammaInv:
// 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