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

GPU Calc: unit test cases for COUPNCD

Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test

AMLOEXT-136 BUG

Change-Id: I00478c7094240f61c4f316eac833756a0ad8edc2
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 483fb8b3
...@@ -161,6 +161,7 @@ public: ...@@ -161,6 +161,7 @@ public:
void testFinacialPriceDiscFormula(); void testFinacialPriceDiscFormula();
void testFinancialDBFormula(); void testFinancialDBFormula();
void testFinancialCouppcdFormula(); void testFinancialCouppcdFormula();
void testFinancialCoupncdFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -253,6 +254,7 @@ public: ...@@ -253,6 +254,7 @@ public:
CPPUNIT_TEST(testFinacialPriceDiscFormula); CPPUNIT_TEST(testFinacialPriceDiscFormula);
CPPUNIT_TEST(testFinancialDBFormula); CPPUNIT_TEST(testFinancialDBFormula);
CPPUNIT_TEST(testFinancialCouppcdFormula); CPPUNIT_TEST(testFinancialCouppcdFormula);
CPPUNIT_TEST(testFinancialCoupncdFormula);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -2676,6 +2678,28 @@ void ScOpenclTest::testStatisticalFormulaConfidence() ...@@ -2676,6 +2678,28 @@ void ScOpenclTest::testStatisticalFormulaConfidence()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-136]
void ScOpenclTest::testFinancialCoupncdFormula()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupncd.", XLS);
ScDocument *pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupncd.", 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();
}
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