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

GPU Calc: unit test cases for COUNTIF

Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-176 BUG

Change-Id: Ia00cf13978f38e9b7272511235e9d45ef80886c8
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 25ed52d2
...@@ -199,6 +199,7 @@ public: ...@@ -199,6 +199,7 @@ public:
void testMathFormulaLog10(); void testMathFormulaLog10();
void testStatisticalFormulaExpondist(); void testStatisticalFormulaExpondist();
void testMathAverageIfsFormula(); void testMathAverageIfsFormula();
void testMathCountIfsFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -329,6 +330,7 @@ public: ...@@ -329,6 +330,7 @@ public:
CPPUNIT_TEST(testMathFormulaLog10); CPPUNIT_TEST(testMathFormulaLog10);
CPPUNIT_TEST(testStatisticalFormulaExpondist); CPPUNIT_TEST(testStatisticalFormulaExpondist);
CPPUNIT_TEST(testMathAverageIfsFormula); CPPUNIT_TEST(testMathAverageIfsFormula);
CPPUNIT_TEST(testMathCountIfsFormula);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3622,6 +3624,28 @@ void ScOpenclTest::testMathFormulaFloor() ...@@ -3622,6 +3624,28 @@ void ScOpenclTest::testMathFormulaFloor()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[ AMLOEXT-176 ]
void ScOpenclTest::testMathCountIfsFormula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/countifs.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
sc::FormulaGroupInterpreter::enableOpenCL(true);
xDocSh->DoHardRecalc(true);
ScDocShellRef xDocShRes = loadDoc("opencl/math/countifs.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 1; i < 10; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[ AMLOEXT-179] //[ AMLOEXT-179]
void ScOpenclTest::testMathAverageIfsFormula() void ScOpenclTest::testMathAverageIfsFormula()
{ {
......
...@@ -1431,6 +1431,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1431,6 +1431,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocLog10: case ocLog10:
case ocExpDist: case ocExpDist:
case ocAverageIfs: case ocAverageIfs:
case ocCountIfs:
// 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