summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorxinjiang <xinjiang@multicorewareinc.com>2013-12-31 15:04:24 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:20:06 -0600
commit5e8ec8912e6f9cb2eb7c3ae726f1f56515753dce (patch)
treea21244446f7bbccc14683053effcb1ba7ae30b7b /sc/qa/unit/opencl-test.cxx
parent1b519473cc7d3f897566e3f66f4930207d8eced4 (diff)
GPU Calc: unit test cases for accuracy not reach 11 in MDURATION
AMLOEXT-223 BUG Change-Id: Ib8349015152da6b641193b8558cb8a2959513631 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 95eeb04d0599..843c9a90b2b1 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -293,6 +293,7 @@ public:
void testStatisticalFormulaVarPA1();
void testStatisticalFormulaStDevA1();
void testStatisticalFormulaStDevPA1();
+ void testFinancialMDurationFormula1();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -517,6 +518,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaVarPA1);
CPPUNIT_TEST(testStatisticalFormulaStDevA1);
CPPUNIT_TEST(testStatisticalFormulaStDevPA1);
+ CPPUNIT_TEST(testFinancialMDurationFormula1);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5162,6 +5164,28 @@ void ScOpenclTest::testStatisticalFormulaStDevPA()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-223]
+void ScOpenclTest:: testFinancialMDurationFormula1()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/MDuration1.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/MDuration1.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 9; ++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.00000000001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-245]
void ScOpenclTest::testMathFormulaSumProduct2()
{