summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authormulei <mulei@multicorewareinc.com>2013-11-04 10:50:50 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-03 23:02:33 -0600
commitb1dbb2d2a893cf15ba8829d70762e5ef23f3542a (patch)
treeee4fd7817c2a67acd548ea3aa2f937a2ef01dbe5 /sc
parent1c239f51064e30713ac87abd3697d73bc5e5bcc1 (diff)
GPU Calc: unit test cases for PRICE
AMLOEXT-63 BUG Change-Id: I747817487fe118106a549674c6918dab544522ba 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/Price.xlsbin0 -> 7680 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/Price.xls b/sc/qa/unit/data/xls/opencl/financial/Price.xls
new file mode 100644
index 000000000000..ed507fd928bc
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/financial/Price.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index dd626cd086d8..7264c7e99a62 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -119,6 +119,7 @@ public:
void testFinacialPMTFormula();
void testFinacialPPMTFormula();
void testFinancialISPMTFormula();
+ void testFinacialPriceFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -169,6 +170,7 @@ public:
CPPUNIT_TEST(testFinacialPPMTFormula);
CPPUNIT_TEST(testFinacialPMTFormula);
CPPUNIT_TEST(testFinancialISPMTFormula);
+ CPPUNIT_TEST(testFinacialPriceFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1094,6 +1096,29 @@ void ScOpenclTest::testStatisticalFormulaNegbinomdist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-63]
+void ScOpenclTest::testFinacialPriceFormula()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/financial/Price.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/financial/Price.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 1; i <= 10; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(7, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(7, i, 0));
+ //CPPUNIT_ASSERT_EQUAL(fExcel, fLibre);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-64]
void ScOpenclTest::testFinacialDollarfrFormula()
{