Kaydet (Commit) c9ba1a8b authored tarafından hongyu zhong's avatar hongyu zhong Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for NORMSDIST

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-102 BUG

Change-Id: I570dc015289d95a9739803f3c01e8c17aef6f1a3
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 2082e778
......@@ -147,6 +147,7 @@ public:
void testMathFormulaArcCosHyp();
void testFinancialXirrFormula();
void testFinacialNPVFormula();
void testStatisticalFormulaNormsdist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -225,6 +226,7 @@ public:
CPPUNIT_TEST(testMathFormulaArcCosHyp);
CPPUNIT_TEST(testFinancialXirrFormula);
CPPUNIT_TEST(testFinacialNPVFormula);
CPPUNIT_TEST(testStatisticalFormulaNormsdist);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -1679,6 +1681,30 @@ void ScOpenclTest::testStatisticalFormulaNormdist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-102]
void ScOpenclTest::testStatisticalFormulaNormsdist()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Normsdist.",XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Normsdist.",XLS);
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(1,i,0));
double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-108]
void ScOpenclTest::testFinacialNPERFormula()
{
......
......@@ -1387,6 +1387,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocSqrt:
case ocArcCosHyp:
case ocNPV:
case ocStdNormDist:
// 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