summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-10-24 15:29:21 +0800
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-29 17:00:11 -0400
commit572280bd7c94d286310b4471c44dea9ddd723026 (patch)
tree7b8345ffa2101e44c7c886dbb56e2e53fbaa9a11
parentfa4ea8733c4c99b788ce10e6bacb48e9b8307245 (diff)
Testcases for COUPDAYBS for GPU Calc
Change-Id: I18f05035603ebf74dac533878efe7c50fbc1a9ad Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/OpenclCase/financial/Coupdaybs.xlsbin0 -> 20480 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx23
2 files changed, 22 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/OpenclCase/financial/Coupdaybs.xls b/sc/qa/unit/data/xls/OpenclCase/financial/Coupdaybs.xls
new file mode 100644
index 000000000000..ca8c8cfb8668
--- /dev/null
+++ b/sc/qa/unit/data/xls/OpenclCase/financial/Coupdaybs.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index c0a25eff3ddd..20c44fbde01c 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -72,7 +72,7 @@ public:
void testStatisticalFormulaGauss();
void testStatisticalFormulaGeoMean();
void testStatisticalFormulaHarMean();
-
+ void testFinancialCoupdaybsFormula();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testSharedFormulaXLSGroundWater);
@@ -92,6 +92,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaGauss);
CPPUNIT_TEST(testStatisticalFormulaGeoMean);
CPPUNIT_TEST(testStatisticalFormulaHarMean);
+ CPPUNIT_TEST(testFinancialCoupdaybsFormula);
CPPUNIT_TEST_SUITE_END();
private:
@@ -689,6 +690,26 @@ void ScOpenclTest::testFinacialMIRRFormula()
xDocShRes->DoClose();
}
+// [AMLOEXT-55]
+void ScOpenclTest::testFinancialCoupdaybsFormula()
+{
+ ScDocShellRef xDocSh = loadDoc("OpenclCase/financial/Coupdaybs.", XLS);
+ enableOpenCL(xDocSh);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ xDocSh->DoHardRecalc(true);
+ ScDocShellRef xDocShRes = loadDoc("OpenclCase/financial/Coupdaybs.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 1; i <=10; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(4, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(4, i, 0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
void ScOpenclTest::testFinacialRateFormula()
{
ScDocShellRef xDocSh = loadDoc("OpenclCase/financial/RATE.", XLS);