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

GPU Calc: unit test cases for NAN argument handling in PPMT

AMLOEXT-119 BUG

Change-Id: I3bc04bfeeeaee80e6d1273d373180d8bf3aaf901
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 7c19dd02
...@@ -117,6 +117,7 @@ public: ...@@ -117,6 +117,7 @@ public:
void testFinacialYIELDDISCFormula(); void testFinacialYIELDDISCFormula();
void testFinacialYIELDMATFormula(); void testFinacialYIELDMATFormula();
void testFinacialPMTFormula(); void testFinacialPMTFormula();
void testFinacialPPMTFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -164,6 +165,7 @@ public: ...@@ -164,6 +165,7 @@ public:
CPPUNIT_TEST(testFinacialYIELDFormula); CPPUNIT_TEST(testFinacialYIELDFormula);
CPPUNIT_TEST(testFinacialYIELDDISCFormula); CPPUNIT_TEST(testFinacialYIELDDISCFormula);
CPPUNIT_TEST(testFinacialYIELDMATFormula); CPPUNIT_TEST(testFinacialYIELDMATFormula);
CPPUNIT_TEST(testFinacialPPMTFormula);
CPPUNIT_TEST(testFinacialPMTFormula); CPPUNIT_TEST(testFinacialPMTFormula);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -1557,7 +1559,28 @@ void ScOpenclTest:: testFinacialPMTFormula() ...@@ -1557,7 +1559,28 @@ void ScOpenclTest:: testFinacialPMTFormula()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-119]
void ScOpenclTest:: testFinacialPPMTFormula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PPMT.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PPMT.", XLS);
ScDocument *pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 6; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(6, i, 0));
double fExcel = pDocRes->GetValue(ScAddress(6, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
ScOpenclTest::ScOpenclTest() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
......
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