summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-11-05 10:02:29 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-12 21:11:04 -0600
commit4bad711ff532bfc1f64b584e8c5cf8fbef38e2ca (patch)
treed59f39abb3e425ccac8d625bebd433e3155ba46b
parentGPU Calc: implement fix for AMORDEGRC in GPU calc (diff)
downloadcore-4bad711ff532bfc1f64b584e8c5cf8fbef38e2ca.tar.gz
core-4bad711ff532bfc1f64b584e8c5cf8fbef38e2ca.zip
GPU Calc: unit test cases for AMORDEGRC in GPU calc
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-98 BUG Change-Id: I0867627c69eefdbc7127d19559af23fbd70b3ccc Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/opencl/financial/Amordegrc.xlsbin0 -> 19968 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/Amordegrc.xls b/sc/qa/unit/data/xls/opencl/financial/Amordegrc.xls
new file mode 100644
index 000000000000..7cb9e474c8b5
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/Amordegrc.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index b040e32dba5b..3c395c40ae53 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -132,6 +132,7 @@ public:
void testStatisticalFormulaWeibull();
void testStatisticalFormulaMedian();
void testFinancialDuration_ADDFormula();
+ void testFinancialAmordegrcFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -195,6 +196,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaWeibull);
CPPUNIT_TEST(testStatisticalFormulaMedian);
CPPUNIT_TEST(testFinancialDuration_ADDFormula);
+ CPPUNIT_TEST(testFinancialAmordegrcFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1514,6 +1516,28 @@ void ScOpenclTest::testFinacialXNPVFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-98]
+void ScOpenclTest::testFinancialAmordegrcFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/Amordegrc.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/Amordegrc.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 9; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-99]
void ScOpenclTest:: testFinancialISPMTFormula()
{