diff options
author | mingli <mingli@multicorewareinc.com> | 2013-12-13 16:55:32 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:53:59 -0600 |
commit | b77514259d6fd317c96494fe5d93ad70b5371380 (patch) | |
tree | 1e8678bbce6d6947e7a9589aeb3ba54a14332646 /sc/qa | |
parent | a418cc7066f56cc980c2bed1dc3600932861c9c5 (diff) |
GPU Calc: unit test cases for AVERAGEA
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-216 BUG
Change-Id: I53e62963490ca01160e85c6aec2c03532e5068dc
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>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/AverageA.xls | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 48 |
2 files changed, 37 insertions, 11 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/AverageA.xls b/sc/qa/unit/data/xls/opencl/statistical/AverageA.xls Binary files differnew file mode 100644 index 000000000000..6ba475b1144b --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/AverageA.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 20957fa28a13..be4a47c11f42 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -272,6 +272,7 @@ public: void testStatisticalFormulaMina(); void testStatisticalFormulaCountA(); void testStatisticalFormulaMaxa(); + void testStatisticalFormulaAverageA(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -474,6 +475,7 @@ public: CPPUNIT_TEST(testMathFormulaFact); CPPUNIT_TEST(testStatisticalFormulaMaxa); CPPUNIT_TEST(testStatisticalFormulaCountA); + CPPUNIT_TEST(testStatisticalFormulaAverageA); CPPUNIT_TEST_SUITE_END(); private: @@ -4967,25 +4969,25 @@ void ScOpenclTest::testMathFormulaAverageIf() xDocSh->DoClose(); xDocShRes->DoClose(); } -//[AMLOEXT-245] -void ScOpenclTest::testMathFormulaSumProduct2() + +//[AMLOEXT-216] +void ScOpenclTest::testStatisticalFormulaAverageA() { if (!detectOpenCLDevice()) return; - ScDocShellRef xDocSh = loadDoc("opencl/math/sumproductTest.", XLS); - ScDocument* pDoc = xDocSh->GetDocument(); + ScDocShellRef xDocSh = loadDoc("opencl/statistical/AverageA.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); CPPUNIT_ASSERT(pDoc); enableOpenCL(); pDoc->CalcAll(); - ScDocShellRef xDocShRes = loadDoc("opencl/math/sumproductTest.", XLS); - ScDocument* pDocRes = xDocShRes->GetDocument(); + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/AverageA.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); CPPUNIT_ASSERT(pDocRes); - // Check the results of formula cells in the shared formula range. - for (SCROW i = 2; i <= 12; ++i) + for (SCROW i = 0; i <= 9; ++i) { - double fLibre = pDoc->GetValue(ScAddress(4,i,1)); - double fExcel = pDocRes->GetValue(ScAddress(4,i,1)); - CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + double fLibre = pDoc->GetValue(ScAddress(6, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(6, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } xDocSh->DoClose(); xDocShRes->DoClose(); @@ -5020,6 +5022,30 @@ void ScOpenclTest:: testLogicalFormulaAnd() xDocShRes->DoClose(); } +//[AMLOEXT-245] +void ScOpenclTest::testMathFormulaSumProduct2() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/sumproductTest.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/sumproductTest.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 2; i <= 12; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(4,i,1)); + double fExcel = pDocRes->GetValue(ScAddress(4,i,1)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} + //[AMLOEXT-243] void ScOpenclTest:: testStatisticalParallelCountBug() { |