summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-11-12 12:37:00 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:26 -0600
commit5d02ff1e4534f201772c467b60f71903894a431b (patch)
treeae2d0b8c3af1bd539a19fae246166e3f70a2af48 /sc/qa
parentcc666857d603cd4be97489339dea1fc4b9dd3554 (diff)
GPU Calc: unit test cases for STDEV
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-184 BUG Change-Id: I0b31255ef182c61f53b4670538b7db029ed83cd8 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/StDev.xlsbin0 -> 8192 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/StDev.xls b/sc/qa/unit/data/xls/opencl/statistical/StDev.xls
new file mode 100644
index 000000000000..da00293c1343
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/StDev.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 877dd707812d..e5f4e1b67219 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -221,6 +221,7 @@ public:
void testMathFormulaCeil();
void testMathFormulaKombin();
void testStatisticalFormulaDevSq();
+ void testStatisticalFormulaStDev();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -373,6 +374,7 @@ public:
CPPUNIT_TEST(testMathFormulaCeil);
CPPUNIT_TEST(testMathFormulaKombin);
CPPUNIT_TEST(testStatisticalFormulaDevSq);
+ CPPUNIT_TEST(testStatisticalFormulaStDev);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4186,6 +4188,31 @@ void ScOpenclTest::testStatisticalFormulaVarP()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-184]
+void ScOpenclTest::testStatisticalFormulaStDev()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDev.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDev.", 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-192]
void ScOpenclTest::testStatisticalFormulaBinomDist()
{