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

GPU Calc: unit test cases for PRICEDISC

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-65 BUG

Change-Id: I69fab20b90fade63cb8084a5993f597cfe7a1e48
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst a293cd38
...@@ -158,6 +158,7 @@ public: ...@@ -158,6 +158,7 @@ public:
void testStatisticalFormulaIntercept(); void testStatisticalFormulaIntercept();
void testFinacialODDLPRICEFormula(); void testFinacialODDLPRICEFormula();
void testFinacialOddlyieldFormula(); void testFinacialOddlyieldFormula();
void testFinacialPriceDiscFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -247,6 +248,7 @@ public: ...@@ -247,6 +248,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaIntercept); CPPUNIT_TEST(testStatisticalFormulaIntercept);
CPPUNIT_TEST(testFinacialODDLPRICEFormula); CPPUNIT_TEST(testFinacialODDLPRICEFormula);
CPPUNIT_TEST(testFinacialOddlyieldFormula); CPPUNIT_TEST(testFinacialOddlyieldFormula);
CPPUNIT_TEST(testFinacialPriceDiscFormula);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -1373,6 +1375,28 @@ void ScOpenclTest::testFinacialDollarfrFormula() ...@@ -1373,6 +1375,28 @@ void ScOpenclTest::testFinacialDollarfrFormula()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-65]
void ScOpenclTest::testFinacialPriceDiscFormula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/PriceDisc.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/PriceDisc.", XLS);
ScDocument *pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 10; ++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-67] //[AMLOEXT-67]
void ScOpenclTest::testFinacialODDLPRICEFormula() void ScOpenclTest::testFinacialODDLPRICEFormula()
{ {
......
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