summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-12-13 14:32:32 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:41 -0600
commite97cb685a565e4518af164014aa4bdc4b9cbbad9 (patch)
tree61090cf4059b1aeaa3470cc182da05354fee3229 /sc/qa/unit/opencl-test.cxx
parent6c041a172676f9512e30109e6c6768ed58679909 (diff)
GPU Calc: unit test cases for ISEVEN
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-357 BUG Change-Id: I58aa4c98207a3f9cafd0a2cec97f3abcca73ed33 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
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()
{