diff options
author | mulei <mulei@multicorewareinc.com> | 2013-11-04 10:50:50 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-03 23:02:33 -0600 |
commit | b1dbb2d2a893cf15ba8829d70762e5ef23f3542a (patch) | |
tree | ee4fd7817c2a67acd548ea3aa2f937a2ef01dbe5 /sc | |
parent | 1c239f51064e30713ac87abd3697d73bc5e5bcc1 (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.xls | bin | 0 -> 7680 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
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 Binary files differnew file mode 100644 index 000000000000..ed507fd928bc --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/financial/Price.xls 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() { |