summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-12-16 10:07:04 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:53:58 -0600
commitad301e7c4fbb44d83360828f4e5bf485cd727d49 (patch)
tree961f4a234142f3e99e3eca285f0cc53697fe5786
parentbcb633c42396c01480bb7a34de45b5ee5ee86d81 (diff)
GPU Calc: unit test cases for COUNTA
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-208 BUG Change-Id: I5da694977363d546d3a3b0be462bea8e3cd3ccb1 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>
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/counta.xlsbin0 -> 8192 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/counta.xls b/sc/qa/unit/data/xls/opencl/statistical/counta.xls
new file mode 100644
index 000000000000..3dc410b5e308
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/counta.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index b35a3a211348..0cd121e41876 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -270,6 +270,7 @@ public:
void testMathFormulaIsOdd();
void testMathFormulaFact();
void testStatisticalFormulaMina();
+ void testStatisticalFormulaCountA();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -470,6 +471,7 @@ public:
CPPUNIT_TEST(testMathFormulaIsEven);
CPPUNIT_TEST(testMathFormulaIsOdd);
CPPUNIT_TEST(testMathFormulaFact);
+ CPPUNIT_TEST(testStatisticalFormulaCountA);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4859,6 +4861,28 @@ void ScOpenclTest:: testArrayFormulaSumXMY2()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//AMLOEXT-208
+void ScOpenclTest::testStatisticalFormulaCountA()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/counta.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/counta.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 9; ++i)
+ {
+ 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();
+}
//[AMLOEXT-214]
void ScOpenclTest::testMathFormulaSumProduct()
{