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

GPU Calc: unit test cases for COUPPCD

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-135 BUG

Change-Id: I57822062ea2672fe3d290f11905330fb4e7b8ba5
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst e667e8d6
......@@ -160,6 +160,7 @@ public:
void testFinacialOddlyieldFormula();
void testFinacialPriceDiscFormula();
void testFinancialDBFormula();
void testFinancialCouppcdFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -251,6 +252,7 @@ public:
CPPUNIT_TEST(testFinacialOddlyieldFormula);
CPPUNIT_TEST(testFinacialPriceDiscFormula);
CPPUNIT_TEST(testFinancialDBFormula);
CPPUNIT_TEST(testFinancialCouppcdFormula);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -2503,6 +2505,28 @@ void ScOpenclTest::testFinancialDBFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-135]
void ScOpenclTest::testFinancialCouppcdFormula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Couppcd.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Couppcd.", XLS);
ScDocument *pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 9; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-128]
void ScOpenclTest::testMathSumIfsFormula()
{
......
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