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

GPU Calc: unit test cases for VAR

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-79 BUG

Change-Id: Iedb355e8ffd5b9ef768baee49d3776fcb7ebb348
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst e8a755e7
...@@ -182,6 +182,7 @@ public: ...@@ -182,6 +182,7 @@ public:
void testMathFormulaCoth(); void testMathFormulaCoth();
void testFinacialNPER1Formula(); void testFinacialNPER1Formula();
void testStatisticalFormulaFDist(); void testStatisticalFormulaFDist();
void testStatisticalFormulaVar();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -295,6 +296,7 @@ public: ...@@ -295,6 +296,7 @@ public:
CPPUNIT_TEST(testMathFormulaCoth); CPPUNIT_TEST(testMathFormulaCoth);
CPPUNIT_TEST(testFinacialNPER1Formula); CPPUNIT_TEST(testFinacialNPER1Formula);
CPPUNIT_TEST(testStatisticalFormulaFDist); CPPUNIT_TEST(testStatisticalFormulaFDist);
CPPUNIT_TEST(testStatisticalFormulaVar);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -1605,6 +1607,31 @@ void ScOpenclTest::testStatisticalFormulaWeibull() ...@@ -1605,6 +1607,31 @@ void ScOpenclTest::testStatisticalFormulaWeibull()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-79]
void ScOpenclTest::testStatisticalFormulaVar()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Var.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Var.", 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-82] //[AMLOEXT-82]
void ScOpenclTest::testStatisticalFormulaPearson() void ScOpenclTest::testStatisticalFormulaPearson()
{ {
......
...@@ -1415,6 +1415,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1415,6 +1415,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCot: case ocCot:
case ocCotHyp: case ocCotHyp:
case ocFDist: case ocFDist:
case ocVar:
// 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