diff options
author | haochen <haochen@multicorewareinc.com> | 2013-10-24 17:18:17 +0800 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-29 17:00:21 -0400 |
commit | 14e3096b5e2a269a0b1c49aeca37b2c8c389d741 (patch) | |
tree | 2b0062a6b34216179d836d3a5ecd08b2194cc096 /sc/qa | |
parent | 4085c1e112fee7dad3d88ee3a2a2d3fbf392f062 (diff) |
Testcases for DISC in GPU Calc
Change-Id: I54992ac813ea4c689c80e5ba0454d3c619ac51c1
Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/OpenclCase/financial/DISC.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 23 |
2 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/OpenclCase/financial/DISC.xls b/sc/qa/unit/data/xls/OpenclCase/financial/DISC.xls Binary files differnew file mode 100644 index 000000000000..3425e92a5028 --- /dev/null +++ b/sc/qa/unit/data/xls/OpenclCase/financial/DISC.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index f1facaaa95af..b4ea6b308105 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -81,6 +81,7 @@ public: void testStatisticalFormulaCorrel(); void testFinancialCoupdaysFormula(); void testFinancialCoupdaysncFormula(); + void testFinacialDISCFormula(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLSGroundWater); @@ -109,6 +110,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaCorrel); CPPUNIT_TEST(testFinancialCoupdaysFormula); CPPUNIT_TEST(testFinancialCoupdaysncFormula); + CPPUNIT_TEST(testFinacialDISCFormula); CPPUNIT_TEST_SUITE_END(); private: @@ -940,6 +942,27 @@ void ScOpenclTest::testFinacialDollarfrFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-71] +void ScOpenclTest::testFinacialDISCFormula() +{ + ScDocShellRef xDocSh = loadDoc("OpenclCase/financial/DISC.", XLS); + enableOpenCL(xDocSh); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + xDocSh->DoHardRecalc(true); + ScDocShellRef xDocShRes = loadDoc("OpenclCase/financial/DISC.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 9; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(5, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(5, i, 0)); + //CPPUNIT_ASSERT_EQUAL(fExcel, fLibre); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |