summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-11-04 11:27:40 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-03 23:48:10 -0600
commit5c744383ebdb053a534dc7ab3aabab4e071cc2b1 (patch)
tree48ece3832d85c04d54b463e65b663f1c85f8b52e /sc
parent0644c59f1e2822c687ef0366f6c02b3b21a3f01a (diff)
GPU Calc: unit test cases for COUPNUM
AMLOEXT-74 BUG Change-Id: Ice115dc1e9b22fdaff9a8fdadabe9b93635ef315 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/opencl/financial/Coupnum.xlsbin0 -> 7168 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/Coupnum.xls b/sc/qa/unit/data/xls/opencl/financial/Coupnum.xls
new file mode 100644
index 000000000000..914612ed1758
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/Coupnum.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 0d228d569007..3d608947cefc 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -121,6 +121,7 @@ public:
void testFinancialISPMTFormula();
void testFinacialPriceFormula();
void testFinancialDurationFormula();
+ void testFinancialCoupnumFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -173,6 +174,7 @@ public:
CPPUNIT_TEST(testFinancialISPMTFormula);
CPPUNIT_TEST(testFinacialPriceFormula);
CPPUNIT_TEST(testFinancialDurationFormula);
+ CPPUNIT_TEST(testFinancialCoupnumFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1074,6 +1076,29 @@ void ScOpenclTest::testFinancialAccrintmFormula()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-74]
+void ScOpenclTest::testFinancialCoupnumFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/Coupnum.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/Coupnum.", 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();
+}
+
//[AMLOEXT-57]
void ScOpenclTest::testStatisticalFormulaNegbinomdist()
{