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

GPU Calc: unit test cases for FLOOR

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-169 BUG

Change-Id: Ib678abfdabd914eb89c712bb14fe7651c3004531
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst c41db78b
......@@ -189,6 +189,7 @@ public:
void testStatisticalFormulaChiSqDist();
void testStatisticalFormulaChiSqInv();
void testStatisticalFormulaGammaInv();
void testMathFormulaFloor();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -309,6 +310,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaChiSqDist);
CPPUNIT_TEST(testStatisticalFormulaChiSqInv);
CPPUNIT_TEST(testStatisticalFormulaGammaInv);
CPPUNIT_TEST(testMathFormulaFloor);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -3410,6 +3412,28 @@ void ScOpenclTest::testStatisticalFormulaChiDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-169]
void ScOpenclTest::testMathFormulaFloor()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/floor.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/floor.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
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()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -1422,6 +1422,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocChiSqDist:
case ocChiSqInv:
case ocGammaInv:
case ocFloor:
// 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