Kaydet (Commit) 5d02ff1e authored tarafından shiming zhang's avatar shiming zhang Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for STDEV

Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-184 BUG

Change-Id: I0b31255ef182c61f53b4670538b7db029ed83cd8
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst cc666857
......@@ -221,6 +221,7 @@ public:
void testMathFormulaCeil();
void testMathFormulaKombin();
void testStatisticalFormulaDevSq();
void testStatisticalFormulaStDev();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -373,6 +374,7 @@ public:
CPPUNIT_TEST(testMathFormulaCeil);
CPPUNIT_TEST(testMathFormulaKombin);
CPPUNIT_TEST(testStatisticalFormulaDevSq);
CPPUNIT_TEST(testStatisticalFormulaStDev);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -4186,6 +4188,31 @@ void ScOpenclTest::testStatisticalFormulaVarP()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-184]
void ScOpenclTest::testStatisticalFormulaStDev()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDev.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDev.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 20; ++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-192]
void ScOpenclTest::testStatisticalFormulaBinomDist()
{
......
......@@ -1453,6 +1453,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCeil:
case ocKombin:
case ocDevSq:
case ocStDev:
// 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