GPU Calc: unit test cases for STANDARDIZE

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-77 BUG

Change-Id: Ie2919ca8d99e19ff2d17fe9d7fc3fbe2a49a4e05
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
This commit is contained in:
shiming zhang
2013-11-04 16:58:38 +08:00
committed by I-Jui (Ray) Sung
parent 6786d9b887
commit f7cd30228f
3 changed files with 28 additions and 0 deletions

Binary file not shown.

View File

@@ -128,6 +128,7 @@ public:
void testMathFormulaSin();
void testMathFormulaTan();
void testMathFormulaTanH();
void testStatisticalFormulaStandard();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -187,6 +188,7 @@ public:
CPPUNIT_TEST(testMathFormulaSin);
CPPUNIT_TEST(testMathFormulaTan);
CPPUNIT_TEST(testMathFormulaTanH);
CPPUNIT_TEST(testStatisticalFormulaStandard);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1359,6 +1361,31 @@ void ScOpenclTest::testFinacialINTRATEFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-77]
void ScOpenclTest::testStatisticalFormulaStandard()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Standard.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Standard.", 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(3,i,0));
double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-82]
void ScOpenclTest::testStatisticalFormulaPearson()
{

View File

@@ -1374,6 +1374,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocSin:
case ocTan:
case ocTanHyp:
case ocStandard:
// Don't change the state.
break;
default: