summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/unit/data/xls/opencl/math/MROUND.xlsbin0 -> 7168 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/MROUND.xls b/sc/qa/unit/data/xls/opencl/math/MROUND.xls
new file mode 100644
index 000000000000..5aeabf3a5cac
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/MROUND.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 293a6fe721e7..53db504d3fa8 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -279,6 +279,7 @@ public:
void testStatisticalFormulaStDevPA();
void testMathFormulaSEC();
void testMathFormulaSECH();
+ void testMathFormulaMROUND();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -488,6 +489,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaStDevPA);
CPPUNIT_TEST(testMathFormulaSEC);
CPPUNIT_TEST(testMathFormulaSECH);
+ CPPUNIT_TEST(testMathFormulaMROUND);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5761,6 +5763,29 @@ void ScOpenclTest::testMathFormulaSECH()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//AMLOEXT-369
+void ScOpenclTest::testMathFormulaMROUND()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/math/MROUND.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/MROUND.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 13; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(2,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{