Kaydet (Commit) a9edef9c authored tarafından fengzeng's avatar fengzeng Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for TRUNC

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-84 BUG

Change-Id: I96d14bd61d6694a5aa2ebf7ca1a53b8ee9de255d
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 9558470f
...@@ -204,6 +204,7 @@ public: ...@@ -204,6 +204,7 @@ public:
void testMathFormulaEven(); void testMathFormulaEven();
void testMathFormulaLog(); void testMathFormulaLog();
void testMathFormulaMod(); void testMathFormulaMod();
void testMathFormulaTrunc();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -339,6 +340,7 @@ public: ...@@ -339,6 +340,7 @@ public:
CPPUNIT_TEST(testMathFormulaEven); CPPUNIT_TEST(testMathFormulaEven);
CPPUNIT_TEST(testMathFormulaLog); CPPUNIT_TEST(testMathFormulaLog);
CPPUNIT_TEST(testMathFormulaMod); CPPUNIT_TEST(testMathFormulaMod);
CPPUNIT_TEST(testMathFormulaTrunc);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -1720,6 +1722,28 @@ void ScOpenclTest::testStatisticalFormulaRsq() ...@@ -1720,6 +1722,28 @@ void ScOpenclTest::testStatisticalFormulaRsq()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-84]
void ScOpenclTest::testMathFormulaTrunc()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/trunc.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/trunc.", 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-85] //[AMLOEXT-85]
void ScOpenclTest::testMathFormulaCosh() void ScOpenclTest::testMathFormulaCosh()
{ {
......
...@@ -1436,6 +1436,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1436,6 +1436,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocEven: case ocEven:
case ocLog: case ocLog:
case ocMod: case ocMod:
case ocTrunc:
// 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