summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-11-17 11:34:17 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-16 23:20:18 -0600
commit0590d20f59d22d01707456ee7afb7f28d7774499 (patch)
treede24eca82980c892c8075d1091c1a3fd30a22899 /sc/qa
parent68ef0136020091e0d868c8bd683c8be2adbffac3 (diff)
GPU Calc: unit test cases for STDEVP
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-185 BUG Change-Id: Icfbc7ff33f9d6fb702353250d29c5166513ff960 Signed-off-by: haochen <haochen@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/StDevP.xlsbin0 -> 8704 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/StDevP.xls b/sc/qa/unit/data/xls/opencl/statistical/StDevP.xls
new file mode 100644
index 000000000000..fff92fc386c5
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/StDevP.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 20673a790291..cebdfa2909bf 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -237,6 +237,7 @@ public:
void testStatisticalFormulaTDist();
void testStatisticalFormulaTInv();
void testArrayFormulaSumXMY2();
+ void testStatisticalFormulaStDevP();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -405,6 +406,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaTDist);
CPPUNIT_TEST(testStatisticalFormulaTInv);
CPPUNIT_TEST(testArrayFormulaSumXMY2);
+ CPPUNIT_TEST(testStatisticalFormulaStDevP);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4310,6 +4312,31 @@ void ScOpenclTest::testStatisticalFormulaStDev()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-185]
+void ScOpenclTest::testStatisticalFormulaStDevP()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevP.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevP.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 20; ++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-186]
void ScOpenclTest::testStatisticalFormulaSlope()
{