Kaydet (Commit) fd911a92 authored tarafından xinjiang's avatar xinjiang Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for CRITBINOM

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-142 BUG

Change-Id: I8528df9d89dc21ae9e3fade580c0631764d74c43
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst efc507ce
...@@ -166,6 +166,7 @@ public: ...@@ -166,6 +166,7 @@ public:
void testStatisticalFormulaLogInv(); void testStatisticalFormulaLogInv();
void testMathFormulaArcCot(); void testMathFormulaArcCot();
void testMathFormulaCosh(); void testMathFormulaCosh();
void testStatisticalFormulaCritBinom();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -263,6 +264,7 @@ public: ...@@ -263,6 +264,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaLogInv); CPPUNIT_TEST(testStatisticalFormulaLogInv);
CPPUNIT_TEST(testMathFormulaArcCot); CPPUNIT_TEST(testMathFormulaArcCot);
CPPUNIT_TEST(testMathFormulaCosh); CPPUNIT_TEST(testMathFormulaCosh);
CPPUNIT_TEST(testStatisticalFormulaCritBinom);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -2802,6 +2804,31 @@ void ScOpenclTest::testFinancialAccrintFormula() ...@@ -2802,6 +2804,31 @@ void ScOpenclTest::testFinancialAccrintFormula()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-142]
void ScOpenclTest::testStatisticalFormulaCritBinom()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/CritBinom.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CritBinom.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 9; ++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() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -1400,6 +1400,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1400,6 +1400,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocLogInv: case ocLogInv:
case ocArcCot: case ocArcCot:
case ocCosHyp: case ocCosHyp:
case ocKritBinom:
// 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