diff options
author | xinjiang <xinjiang@multicorewareinc.com> | 2013-11-05 09:31:14 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-12 20:41:08 -0600 |
commit | 20029a72b3bb9a119e99bff7974bf6bb20e17924 (patch) | |
tree | 20f33764c3c0f05769f79e934b84cc3e2d5ce084 | |
parent | GPU Calc: implement fix for DURATION_ADD (diff) | |
download | core-20029a72b3bb9a119e99bff7974bf6bb20e17924.tar.gz core-20029a72b3bb9a119e99bff7974bf6bb20e17924.zip |
GPU Calc: unit test cases for DURATION_ADD
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-121 BUG
Change-Id: Id78c89f77cdfe14d368831c22ff708b968e8fee2
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/Duration_ADD.xls | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
2 files changed, 24 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/financial/Duration_ADD.xls b/sc/qa/unit/data/xls/opencl/financial/Duration_ADD.xls Binary files differnew file mode 100644 index 000000000000..18e5ddb752c8 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/financial/Duration_ADD.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b593174bc73e..b040e32dba5b 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -131,6 +131,7 @@ public: void testStatisticalFormulaStandard(); void testStatisticalFormulaWeibull(); void testStatisticalFormulaMedian(); + void testFinancialDuration_ADDFormula(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -193,6 +194,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaStandard); CPPUNIT_TEST(testStatisticalFormulaWeibull); CPPUNIT_TEST(testStatisticalFormulaMedian); + CPPUNIT_TEST(testFinancialDuration_ADDFormula); CPPUNIT_TEST_SUITE_END(); private: @@ -1902,7 +1904,28 @@ void ScOpenclTest:: testFinacialPPMTFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } - +//[AMLOEXT-121] +void ScOpenclTest:: testFinancialDuration_ADDFormula() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/financial/Duration_ADD.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/financial/Duration_ADD.", 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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |