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

GPU Calc: unit test cases for SUMXMY2

Turn  NO_FALLBACK_TO_SWINTERP on in  formulagroupcl.cxx for test

AMLOEXT-204 BUG

Change-Id: Ie9c124ecf8d88915e037c0f36f8e46c4e0e97801
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 4fc3fbb2
......@@ -236,6 +236,7 @@ public:
void testStatisticalFormulaTTest();
void testStatisticalFormulaTDist();
void testStatisticalFormulaTInv();
void testArrayFormulaSumXMY2();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -403,6 +404,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaTTest);
CPPUNIT_TEST(testStatisticalFormulaTDist);
CPPUNIT_TEST(testStatisticalFormulaTInv);
CPPUNIT_TEST(testArrayFormulaSumXMY2);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -4628,6 +4630,34 @@ void ScOpenclTest::testStatisticalFormulaBetainv()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[ AMLOEXT-204]
void ScOpenclTest:: testArrayFormulaSumXMY2()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/array/SUMXMY2.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMXMY2.", 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()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -1467,6 +1467,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocTTest:
case ocTDist:
case ocTInv:
case ocSumXMY2:
// 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