Kaydet (Commit) a1e6bbbd authored tarafından yiming ju's avatar yiming ju Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for SUMX2PY2

Need macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-200 BUG

Change-Id: I2eb1c8b30989391d683400eef89b4543edd69f1e
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 2e348a2e
...@@ -231,6 +231,7 @@ public: ...@@ -231,6 +231,7 @@ public:
void testMathFormulaProduct(); void testMathFormulaProduct();
void testStatisticalFormulaHypGeomDist(); void testStatisticalFormulaHypGeomDist();
void testArrayFormulaSumX2MY2(); void testArrayFormulaSumX2MY2();
void testArrayFormulaSumX2PY2();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -393,6 +394,7 @@ public: ...@@ -393,6 +394,7 @@ public:
CPPUNIT_TEST(testMathFormulaProduct); CPPUNIT_TEST(testMathFormulaProduct);
CPPUNIT_TEST(testStatisticalFormulaHypGeomDist); CPPUNIT_TEST(testStatisticalFormulaHypGeomDist);
CPPUNIT_TEST(testArrayFormulaSumX2MY2); CPPUNIT_TEST(testArrayFormulaSumX2MY2);
CPPUNIT_TEST(testArrayFormulaSumX2PY2);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -4492,7 +4494,34 @@ void ScOpenclTest::testStatisticalFormulaHypGeomDist() ...@@ -4492,7 +4494,34 @@ void ScOpenclTest::testStatisticalFormulaHypGeomDist()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-200]
void ScOpenclTest:: testArrayFormulaSumX2PY2()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/array/SUMX2PY2.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMX2PY2.", XLS);
ScDocument *pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 9; ++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));
}
for (SCROW i = 20; i <= 26; ++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();
}
ScOpenclTest::ScOpenclTest() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -1462,6 +1462,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1462,6 +1462,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocProduct: case ocProduct:
case ocHypGeomDist: case ocHypGeomDist:
case ocSumX2MY2: case ocSumX2MY2:
case ocSumX2DY2:
// 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