Kaydet (Commit) 99910c63 authored tarafından dechuang's avatar dechuang Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for POWER

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-117 BUG

Change-Id: I4bcfe78e88d92a806302a0d55f6207a48ee22080
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst a115ee4c
......@@ -184,6 +184,7 @@ public:
void testStatisticalFormulaFDist();
void testStatisticalFormulaVar();
void testStatisticalFormulaChiDist();
void testMathFormulaPower();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -299,6 +300,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaFDist);
CPPUNIT_TEST(testStatisticalFormulaVar);
CPPUNIT_TEST(testStatisticalFormulaChiDist);
CPPUNIT_TEST(testMathFormulaPower);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -2515,6 +2517,28 @@ void ScOpenclTest::testMathFormulaArcCos()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-117]
void ScOpenclTest::testMathFormulaPower()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/power.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/power.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 15; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(2,i,0));
double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-119]
void ScOpenclTest:: testFinacialPPMTFormula()
{
......
......@@ -1417,6 +1417,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocFDist:
case ocVar:
case ocChiDist:
case ocPower:
// 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