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

GPU Calc: unit test cases for COTH

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-91 BUG

Change-Id: Icd18c89de26f222d0a4193a238b1b635ecc957a2
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 76af0bf4
......@@ -179,6 +179,7 @@ public:
void testMathFormulaLN();
void testMathFormulaRound();
void testMathFormulaCot();
void testMathFormulaCoth();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -289,6 +290,7 @@ public:
CPPUNIT_TEST(testMathFormulaLN);
CPPUNIT_TEST(testMathFormulaRound);
CPPUNIT_TEST(testMathFormulaCot);
CPPUNIT_TEST(testMathFormulaCoth);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -1736,6 +1738,29 @@ void ScOpenclTest::testMathFormulaCsc()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-91]
void ScOpenclTest::testMathFormulaCoth()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/math/coth.", ODS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/math/coth.", ODS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 15; ++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-92]
void ScOpenclTest::testFinacialXNPVFormula()
{
......
......@@ -1413,6 +1413,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocLn:
case ocRound:
case ocCot:
case ocCotHyp:
// Don't change the state.
break;
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