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

GPU Calc: unit test cases for NPER with formula argument

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-146 BUG

Change-Id: I0884f0c43c3a84c10abb0f1cc391b57b67006c1f
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 8aa6ad0a
...@@ -180,6 +180,7 @@ public: ...@@ -180,6 +180,7 @@ public:
void testMathFormulaRound(); void testMathFormulaRound();
void testMathFormulaCot(); void testMathFormulaCot();
void testMathFormulaCoth(); void testMathFormulaCoth();
void testFinacialNPER1Formula();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -291,6 +292,7 @@ public: ...@@ -291,6 +292,7 @@ public:
CPPUNIT_TEST(testMathFormulaRound); CPPUNIT_TEST(testMathFormulaRound);
CPPUNIT_TEST(testMathFormulaCot); CPPUNIT_TEST(testMathFormulaCot);
CPPUNIT_TEST(testMathFormulaCoth); CPPUNIT_TEST(testMathFormulaCoth);
CPPUNIT_TEST(testFinacialNPER1Formula);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -3075,6 +3077,28 @@ void ScOpenclTest::testMathFormulaArcTanHyp() ...@@ -3075,6 +3077,28 @@ void ScOpenclTest::testMathFormulaArcTanHyp()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-146]
void ScOpenclTest:: testFinacialNPER1Formula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/NPER1.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/NPER1.", XLS);
ScDocument *pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 6; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(5, i, 0));
double fExcel = pDocRes->GetValue(ScAddress(5, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-149] //[AMLOEXT-149]
void ScOpenclTest::testMathFormulaBitAnd() void ScOpenclTest::testMathFormulaBitAnd()
{ {
......
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