Kaydet (Commit) 349d7cf7 authored tarafından tianyao's avatar tianyao Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for EXP

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-165 BUG

Change-Id: If3661eaa7938d383c239a5978f748015d6f021a4
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 7ccd1f32
......@@ -195,6 +195,7 @@ public:
void testStatisticalFormulaB();
void testStatisticalFormulaBetaDist();
void testMathFormulaCscH();
void testMathFormulaExp();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -321,6 +322,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaB);
CPPUNIT_TEST(testStatisticalFormulaBetaDist);
CPPUNIT_TEST(testMathFormulaCscH);
CPPUNIT_TEST(testMathFormulaExp);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -3524,6 +3526,28 @@ void ScOpenclTest::testStatisticalFormulaBetaDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-165]
void ScOpenclTest::testMathFormulaExp()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/exp.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/exp.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 15; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(1,i,0));
double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-166]
void ScOpenclTest::testStatisticalFormulaChiDist()
{
......
......@@ -1427,6 +1427,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocFTest:
case ocB:
case ocBetaDist:
case ocExp:
// 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