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: ...@@ -189,6 +189,7 @@ public:
void testStatisticalFormulaChiSqDist(); void testStatisticalFormulaChiSqDist();
void testStatisticalFormulaChiSqInv(); void testStatisticalFormulaChiSqInv();
void testStatisticalFormulaGammaInv(); void testStatisticalFormulaGammaInv();
void testMathFormulaFloor();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -309,6 +310,7 @@ public: ...@@ -309,6 +310,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaChiSqDist); CPPUNIT_TEST(testStatisticalFormulaChiSqDist);
CPPUNIT_TEST(testStatisticalFormulaChiSqInv); CPPUNIT_TEST(testStatisticalFormulaChiSqInv);
CPPUNIT_TEST(testStatisticalFormulaGammaInv); CPPUNIT_TEST(testStatisticalFormulaGammaInv);
CPPUNIT_TEST(testMathFormulaFloor);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3410,6 +3412,28 @@ void ScOpenclTest::testStatisticalFormulaChiDist() ...@@ -3410,6 +3412,28 @@ void ScOpenclTest::testStatisticalFormulaChiDist()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->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() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -1422,6 +1422,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1422,6 +1422,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocChiSqDist: case ocChiSqDist:
case ocChiSqInv: case ocChiSqInv:
case ocGammaInv: case ocGammaInv:
case ocFloor:
// 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