summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-12-31 12:38:44 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:57 -0600
commit979567eea57751bf1c1195371bdf2c6c17d0d828 (patch)
tree208125e401c3b0caf15776319f822ceefdbd7ab7 /sc/qa/unit/opencl-test.cxx
parent01ae85fdd1c8f5e06ff8e25a75bbeb0325768acc (diff)
GPU Calc: unit test cases for Not support multiple data types of HARMEAN
AMLOEXT-401 BUG Change-Id: I7960b47c62a4a5d65e0ae5814d5b14763cea4e74 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 2635988d5a6a..98e8917b4e1b 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -288,6 +288,7 @@ public:
void testStatisticalFormulaAvedev();
void testMathFormulaAverageIf_Mix();
void testStatisticalFormulaKurt1();
+ void testStatisticalFormulaHarMean1();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -507,6 +508,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaAvedev);
CPPUNIT_TEST(testMathFormulaAverageIf_Mix);
CPPUNIT_TEST(testStatisticalFormulaKurt1);
+ CPPUNIT_TEST(testStatisticalFormulaHarMean1);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5994,6 +5996,29 @@ void ScOpenclTest::testStatisticalFormulaKurt1()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-401]
+void ScOpenclTest::testStatisticalFormulaHarMean1()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/HarMean1.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/HarMean1.", 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();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{