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

GPU Calc: unit test cases for LOG10

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-180 BUG

Change-Id: Ie52bc244f40df8624c49a3a31406cb5be5f04ac4
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 3fa3072b
......@@ -196,6 +196,7 @@ public:
void testStatisticalFormulaBetaDist();
void testMathFormulaCscH();
void testMathFormulaExp();
void testMathFormulaLog10();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -323,6 +324,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaBetaDist);
CPPUNIT_TEST(testMathFormulaCscH);
CPPUNIT_TEST(testMathFormulaExp);
CPPUNIT_TEST(testMathFormulaLog10);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -3593,6 +3595,28 @@ void ScOpenclTest::testMathFormulaFloor()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-180]
void ScOpenclTest::testMathFormulaLog10()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/log10.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/log10.", 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();
}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -1428,6 +1428,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocB:
case ocBetaDist:
case ocExp:
case ocLog10:
// 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