Kaydet (Commit) f7e6521e authored tarafından yiming ju's avatar yiming ju Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for COVAR

Turn  NO_FALLBACK_TO_SWINTERP on in  formulagroupcl.cxx for test

AMLOEXT-86 BUG

Change-Id: Ie35b4fe1efcdd21e8488ce560c30bd3fca6aa30c
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst e57f0156
...@@ -238,6 +238,7 @@ public: ...@@ -238,6 +238,7 @@ public:
void testStatisticalFormulaTInv(); void testStatisticalFormulaTInv();
void testArrayFormulaSumXMY2(); void testArrayFormulaSumXMY2();
void testStatisticalFormulaStDevP(); void testStatisticalFormulaStDevP();
void testStatisticalFormulaCovar();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -407,6 +408,7 @@ public: ...@@ -407,6 +408,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaTInv); CPPUNIT_TEST(testStatisticalFormulaTInv);
CPPUNIT_TEST(testArrayFormulaSumXMY2); CPPUNIT_TEST(testArrayFormulaSumXMY2);
CPPUNIT_TEST(testStatisticalFormulaStDevP); CPPUNIT_TEST(testStatisticalFormulaStDevP);
CPPUNIT_TEST(testStatisticalFormulaCovar);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -1951,6 +1953,31 @@ void ScOpenclTest::testMathFormulaCosh() ...@@ -1951,6 +1953,31 @@ void ScOpenclTest::testMathFormulaCosh()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
void ScOpenclTest::testStatisticalFormulaCovar()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Covar.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Covar.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 0; i <= 16; ++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();
}
//[AMLOEXT-87] //[AMLOEXT-87]
void ScOpenclTest::testStatisticalFormulaKurt() void ScOpenclTest::testStatisticalFormulaKurt()
{ {
......
...@@ -1469,6 +1469,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1469,6 +1469,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocTInv: case ocTInv:
case ocSumXMY2: case ocSumXMY2:
case ocStDevP: case ocStDevP:
case ocCovar:
// Don't change the state. // Don't change the state.
break; break;
default: 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