diff options
author | mulei <mulei@multicorewareinc.com> | 2013-11-06 13:52:19 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 14:39:23 -0600 |
commit | 76451b69743b0c50ed0f7ab4cc64bd51656aa30d (patch) | |
tree | e6fce84338cfea24d5c3de4a4109a11a23257789 | |
parent | a293cd388cc14aa1b4a1c954576749dda176fce9 (diff) |
GPU Calc: unit test cases for PRICEDISC
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-65 BUG
Change-Id: I69fab20b90fade63cb8084a5993f597cfe7a1e48
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/PriceDisc.xls | bin | 0 -> 7680 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/PriceDisc.xls b/sc/qa/unit/data/xls/opencl/financial/PriceDisc.xls Binary files differnew file mode 100644 index 000000000000..16269e935727 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/financial/PriceDisc.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 92a343d0e8b0..f32f585be477 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -158,6 +158,7 @@ public: void testStatisticalFormulaIntercept(); void testFinacialODDLPRICEFormula(); void testFinacialOddlyieldFormula(); + void testFinacialPriceDiscFormula(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -247,6 +248,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaIntercept); CPPUNIT_TEST(testFinacialODDLPRICEFormula); CPPUNIT_TEST(testFinacialOddlyieldFormula); + CPPUNIT_TEST(testFinacialPriceDiscFormula); CPPUNIT_TEST_SUITE_END(); private: @@ -1373,6 +1375,28 @@ void ScOpenclTest::testFinacialDollarfrFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-65] +void ScOpenclTest::testFinacialPriceDiscFormula() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/financial/PriceDisc.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/financial/PriceDisc.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 10; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(5, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(5, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-67] void ScOpenclTest::testFinacialODDLPRICEFormula() { |