summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-10-24 15:03:47 +0800
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-29 17:00:10 -0400
commit21c32e7eb8a185abf0799405eb98480bf3a37077 (patch)
tree707243f3d284bff171bcb917dea8998130fd0cf6 /sc/qa
parente409cd02e5956173aabb1374205526c85c8ca3a5 (diff)
Testcases for HARMEAN for GPU Calc
Change-Id: I1bec0361de76bc6a707b6598251bce94bc2847fb Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xls/OpenclCase/statistical/HarMean.xlsbin0 -> 8704 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx22
2 files changed, 22 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/OpenclCase/statistical/HarMean.xls b/sc/qa/unit/data/xls/OpenclCase/statistical/HarMean.xls
new file mode 100644
index 000000000000..55bb9fb4fda8
--- /dev/null
+++ b/sc/qa/unit/data/xls/OpenclCase/statistical/HarMean.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index ae1b075d6427..1f5b38ff3622 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -70,6 +70,7 @@ public:
void testFinacialSLNFormula();
void testStatisticalFormulaGammaLn();
void testStatisticalFormulaGauss();
+ void testStatisticalFormulaHarMean();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
@@ -88,6 +89,7 @@ public:
CPPUNIT_TEST(testFinancialAccrintmFormula);
CPPUNIT_TEST(testStatisticalFormulaGammaLn);
CPPUNIT_TEST(testStatisticalFormulaGauss);
+ CPPUNIT_TEST(testStatisticalFormulaHarMean);
CPPUNIT_TEST_SUITE_END();
private:
@@ -602,6 +604,26 @@ void ScOpenclTest::testStatisticalFormulaGauss()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-51]
+void ScOpenclTest::testStatisticalFormulaHarMean()
+{
+ ScDocShellRef xDocSh = loadDoc("OpenclCase/statistical/HarMean.", XLS);
+ enableOpenCL(xDocSh);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc); xDocSh->DoHardRecalc(true);
+ ScDocShellRef xDocShRes = loadDoc("OpenclCase/statistical/HarMean.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 19; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-53]
void ScOpenclTest::testFinacialSLNFormula()
{