Kaydet (Commit) 35a0fe36 authored tarafından zhenyu yuan's avatar zhenyu yuan Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for COMBINA

Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-174 BUG

Change-Id: Ibbceca14c2d3a0450bc55cd76d0fa116860a0513
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 717a0129
......@@ -200,6 +200,7 @@ public:
void testStatisticalFormulaExpondist();
void testMathAverageIfsFormula();
void testMathCountIfsFormula();
void testMathFormulaCombina();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -331,6 +332,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaExpondist);
CPPUNIT_TEST(testMathAverageIfsFormula);
CPPUNIT_TEST(testMathCountIfsFormula);
CPPUNIT_TEST(testMathFormulaCombina);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -3691,6 +3693,29 @@ void ScOpenclTest::testMathFormulaLog10()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-174]
void ScOpenclTest::testMathFormulaCombina()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/combina.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/combina.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 47; ++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" )
{
......
......@@ -1432,6 +1432,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocExpDist:
case ocAverageIfs:
case ocCountIfs:
case ocKombin2:
// 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