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.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 1bfb6d27c354..570255aeb7dc 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -266,6 +266,7 @@ public:
void testMathFormulaInt();
void testMathFormulaRadians();
void testMathFormulaCountIf();
+ void testMathFormulaIsEven();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -463,6 +464,7 @@ public:
CPPUNIT_TEST(testMathFormulaInt);
CPPUNIT_TEST(testMathFormulaRadians);
CPPUNIT_TEST(testMathFormulaCountIf);
+ CPPUNIT_TEST(testMathFormulaIsEven);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5411,6 +5413,29 @@ void ScOpenclTest::testMathFormulaDegrees()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[ AMLOEXT-357]
+void ScOpenclTest::testMathFormulaIsEven()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/iseven.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/iseven.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 9; ++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-360]
void ScOpenclTest::testMathFormulaCountIf()
{