summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-10-24 17:18:17 +0800
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-29 17:00:21 -0400
commit14e3096b5e2a269a0b1c49aeca37b2c8c389d741 (patch)
tree2b0062a6b34216179d836d3a5ecd08b2194cc096 /sc/qa
parent4085c1e112fee7dad3d88ee3a2a2d3fbf392f062 (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.xlsbin0 -> 6656 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx23
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
new file mode 100644
index 000000000000..3425e92a5028
--- /dev/null
+++ b/sc/qa/unit/data/xls/OpenclCase/financial/DISC.xls
Binary files differ
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" )
{