diff options
author | minwang <min@multicorewareinc.com> | 2013-11-05 10:28:57 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-12 21:31:55 -0600 |
commit | 89ed6a0e150549fb5aa00f06216637ea71b04f30 (patch) | |
tree | 7612cc4b11cc95fde6e566e569e36da80c2ff03a | |
parent | GPU Calc: implement fix for AMORLINC in GPU calc (diff) | |
download | core-89ed6a0e150549fb5aa00f06216637ea71b04f30.tar.gz core-89ed6a0e150549fb5aa00f06216637ea71b04f30.zip |
GPU Calc: unit test cases for AMORLINC in GPU calc
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-110 BUG
Change-Id: Ia6e1333e7d1c91ff9b8a916109a8aa60f4725e03
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/Amorlinc.xls | bin | 0 -> 20480 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/Amorlinc.xls b/sc/qa/unit/data/xls/opencl/financial/Amorlinc.xls Binary files differnew file mode 100644 index 000000000000..59623342b94d --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/financial/Amorlinc.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 3c395c40ae53..bc261134d1b0 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -133,6 +133,7 @@ public: void testStatisticalFormulaMedian(); void testFinancialDuration_ADDFormula(); void testFinancialAmordegrcFormula(); + void testFinancialAmorlincFormula(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -197,6 +198,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaMedian); CPPUNIT_TEST(testFinancialDuration_ADDFormula); CPPUNIT_TEST(testFinancialAmordegrcFormula); + CPPUNIT_TEST(testFinancialAmorlincFormula); CPPUNIT_TEST_SUITE_END(); private: @@ -1583,6 +1585,28 @@ void ScOpenclTest::testStatisticalFormulaMedian() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-110] +void ScOpenclTest::testFinancialAmorlincFormula() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/financial/Amorlinc.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/financial/Amorlinc.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 9; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(7, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(7, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} void ScOpenclTest::testFinacialPriceMatFormula() { if (!detectOpenCLDevice()) |