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

GPU Calc: unit test cases for COMBIN

Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-194 BUG

Change-Id: I7389daf865559dd6ec0908889d1c1d6703d8e9a0
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst edefa3bd
......@@ -219,6 +219,7 @@ public:
void testStatisticalFormulaBinomDist();
void testStatisticalFormulaVarP();
void testMathFormulaCeil();
void testMathFormulaKombin();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -369,6 +370,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaBinomDist);
CPPUNIT_TEST(testStatisticalFormulaVarP);
CPPUNIT_TEST(testMathFormulaCeil);
CPPUNIT_TEST(testMathFormulaKombin);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -4180,6 +4182,29 @@ void ScOpenclTest::testStatisticalFormulaBinomDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-194]
void ScOpenclTest::testMathFormulaKombin()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/Kombin.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/Kombin.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Verify Combin Function
for (SCROW i = 1; i <= 20; ++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" )
{
......
......@@ -1451,6 +1451,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocBinomDist:
case ocVarP:
case ocCeil:
case ocKombin:
// 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