summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
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()
{