summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorxinjiang <xinjiang@multicorewareinc.com>2013-11-06 12:28:28 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 14:39:19 -0600
commitcbb414241e710fb6cf65f8533983407dc6cb2a70 (patch)
tree958923d0e54095cf2a32ce89b2685d88477525fa /sc/qa
parente2e1a878c6010820f4371dbb28198fa79cab74cc (diff)
GPU Calc: unit test cases for IPMT
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-134 BUG Change-Id: I14df6a7b3ecb874d88c97419bd394846655f048a Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xls/opencl/financial/IPMT.xlsbin0 -> 6656 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/IPMT.xls b/sc/qa/unit/data/xls/opencl/financial/IPMT.xls
new file mode 100644
index 000000000000..dbb6e518c9e5
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/IPMT.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 93a66cf1f72e..ec0cebc94afe 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -153,6 +153,7 @@ public:
void testStatisticalFormulaPermut();
void testStatisticalFormulaPermutation();
void testStatisticalFormulaPhi();
+ void testFinancialIPMTFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -237,6 +238,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaPermut);
CPPUNIT_TEST(testStatisticalFormulaPermutation);
CPPUNIT_TEST(testStatisticalFormulaPhi);
+ CPPUNIT_TEST(testFinancialIPMTFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -2452,6 +2454,28 @@ void ScOpenclTest:: testFinancialVDBFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-134]
+void ScOpenclTest:: testFinancialIPMTFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/IPMT.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/IPMT.", 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.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-137]
void ScOpenclTest:: testFinancialXirrFormula()
{