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

GPU Calc: unit test cases for TDIST

Turn  NO_FALLBACK_TO_SWINTERP on in  formulagroupcl.cxx for test

AMLOEXT-190 BUG

Change-Id: I7d48101f41c592e8c83bd82aa87767e188ce37da
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst a81e6fb3
...@@ -234,6 +234,7 @@ public: ...@@ -234,6 +234,7 @@ public:
void testArrayFormulaSumX2PY2(); void testArrayFormulaSumX2PY2();
void testStatisticalFormulaBetainv(); void testStatisticalFormulaBetainv();
void testStatisticalFormulaTTest(); void testStatisticalFormulaTTest();
void testStatisticalFormulaTDist();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -399,6 +400,7 @@ public: ...@@ -399,6 +400,7 @@ public:
CPPUNIT_TEST(testArrayFormulaSumX2PY2); CPPUNIT_TEST(testArrayFormulaSumX2PY2);
CPPUNIT_TEST(testStatisticalFormulaBetainv); CPPUNIT_TEST(testStatisticalFormulaBetainv);
CPPUNIT_TEST(testStatisticalFormulaTTest); CPPUNIT_TEST(testStatisticalFormulaTTest);
CPPUNIT_TEST(testStatisticalFormulaTDist);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -4404,6 +4406,31 @@ void ScOpenclTest::testStatisticalFormulaTTest() ...@@ -4404,6 +4406,31 @@ void ScOpenclTest::testStatisticalFormulaTTest()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-190]
void ScOpenclTest::testStatisticalFormulaTDist()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/TDist.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/TDist.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++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-192] //[AMLOEXT-192]
void ScOpenclTest::testStatisticalFormulaBinomDist() void ScOpenclTest::testStatisticalFormulaBinomDist()
{ {
......
...@@ -1465,6 +1465,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1465,6 +1465,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocSumX2DY2: case ocSumX2DY2:
case ocBetaInv: case ocBetaInv:
case ocTTest: case ocTTest:
case ocTDist:
// 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