Kaydet (Commit) 848b91fb authored tarafından mingli's avatar mingli Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for LOGNORMDIST

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-112 BUG

Change-Id: I4ab444e974499138afe330c9ccb9da640f8d3724
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 522393ae
......@@ -174,6 +174,7 @@ public:
void testMathFormulaArcTanHyp();
void testMathFormulaBitAnd();
void testStatisticalFormulaForecast();
void testStatisticalFormulaLogNormDist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -279,6 +280,7 @@ public:
CPPUNIT_TEST(testMathFormulaArcTanHyp);
CPPUNIT_TEST(testMathFormulaBitAnd);
CPPUNIT_TEST(testStatisticalFormulaForecast);
CPPUNIT_TEST(testStatisticalFormulaLogNormDist);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -2374,6 +2376,31 @@ void ScOpenclTest:: testFinancialDurationFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-112]
void ScOpenclTest::testStatisticalFormulaLogNormDist()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/LogNormDist.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/LogNormDist.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(4,i,0));
double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-113]
void ScOpenclTest::testMathFormulaArcCos()
{
......
......@@ -1408,6 +1408,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocArcTanHyp:
case ocBitAnd:
case ocForecast:
case ocLogNormDist:
// 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