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

GPU Calc: unit test cases for DB

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-132 BUG

Change-Id: I89dca4895fd8952ec085a30d42d75e05e0ed96d1
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 570aa2e9
......@@ -159,6 +159,7 @@ public:
void testFinacialODDLPRICEFormula();
void testFinacialOddlyieldFormula();
void testFinacialPriceDiscFormula();
void testFinancialDBFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -249,6 +250,7 @@ public:
CPPUNIT_TEST(testFinacialODDLPRICEFormula);
CPPUNIT_TEST(testFinacialOddlyieldFormula);
CPPUNIT_TEST(testFinacialPriceDiscFormula);
CPPUNIT_TEST(testFinancialDBFormula);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -2479,6 +2481,28 @@ void ScOpenclTest:: testFinancialFVFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
//[AMLOEXT-132]
void ScOpenclTest::testFinancialDBFormula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/db.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/db.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
for (SCROW i = 0; i <= 9; ++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-128]
void ScOpenclTest::testMathSumIfsFormula()
{
......
......@@ -1396,6 +1396,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocZinsZ:
case ocConfidence:
case ocIntercept:
case ocGDA2:
// 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