summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index aaeddfec18db..0ea81b316551 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -252,6 +252,7 @@ public:
void testDatabaseFormulaDmin();
void testDatabaseFormulaDproduct();
void testDatabaseFormulaDaverage();
+ void testDatabaseFormulaDstdev();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -435,6 +436,7 @@ public:
CPPUNIT_TEST(testDatabaseFormulaDmin);
CPPUNIT_TEST(testDatabaseFormulaDproduct);
CPPUNIT_TEST(testDatabaseFormulaDaverage);
+ CPPUNIT_TEST(testDatabaseFormulaDstdev);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5078,6 +5080,32 @@ void ScOpenclTest::testDatabaseFormulaDaverage()
xDocShRes->DoClose();
}
+//[AMLOEXT-339]
+void ScOpenclTest::testDatabaseFormulaDstdev()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/database/dstdev.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/database/dstdev.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 32; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(9,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ //CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
+
+