Kaydet (Commit) e8d98085 authored tarafından zhenyu yuan's avatar zhenyu yuan Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for MOD

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-155 BUG

Change-Id: Iff3244e086b600d4636656daf9cc8b2a4b0bc578
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst e7e69e9d
...@@ -203,6 +203,7 @@ public: ...@@ -203,6 +203,7 @@ public:
void testMathFormulaCombina(); void testMathFormulaCombina();
void testMathFormulaEven(); void testMathFormulaEven();
void testMathFormulaLog(); void testMathFormulaLog();
void testMathFormulaMod();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -337,6 +338,7 @@ public: ...@@ -337,6 +338,7 @@ public:
CPPUNIT_TEST(testMathFormulaCombina); CPPUNIT_TEST(testMathFormulaCombina);
CPPUNIT_TEST(testMathFormulaEven); CPPUNIT_TEST(testMathFormulaEven);
CPPUNIT_TEST(testMathFormulaLog); CPPUNIT_TEST(testMathFormulaLog);
CPPUNIT_TEST(testMathFormulaMod);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3380,6 +3382,29 @@ void ScOpenclTest::testMathFormulaLN() ...@@ -3380,6 +3382,29 @@ void ScOpenclTest::testMathFormulaLN()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//AMLOEXT-155
void ScOpenclTest::testMathFormulaMod()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/mod.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/mod.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 15; ++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-156] //[ AMLOEXT-156]
void ScOpenclTest::testMathFormulaRound() void ScOpenclTest::testMathFormulaRound()
{ {
......
...@@ -1435,6 +1435,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1435,6 +1435,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocKombin2: case ocKombin2:
case ocEven: case ocEven:
case ocLog: case ocLog:
case ocMod:
// 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