From 5b78a9532463add2dd696d70e1603b9710735864 Mon Sep 17 00:00:00 2001 From: zhenyu yuan Date: Sat, 9 Nov 2013 19:20:14 +0800 Subject: GPU Calc: unit test cases for EVEN Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-164 BUG Change-Id: I0865b83ce49172ccc53ab301290b037e3bd533cc Signed-off-by: haochen Signed-off-by: I-Jui (Ray) Sung --- sc/qa/unit/data/xls/opencl/math/even.xls | Bin 0 -> 6656 bytes sc/qa/unit/opencl-test.cxx | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 sc/qa/unit/data/xls/opencl/math/even.xls (limited to 'sc/qa/unit') diff --git a/sc/qa/unit/data/xls/opencl/math/even.xls b/sc/qa/unit/data/xls/opencl/math/even.xls new file mode 100644 index 000000000000..b882d7ed3a71 Binary files /dev/null and b/sc/qa/unit/data/xls/opencl/math/even.xls differ diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 549ab4e6724e..657da6a893be 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -201,6 +201,7 @@ public: void testMathAverageIfsFormula(); void testMathCountIfsFormula(); void testMathFormulaCombina(); + void testMathFormulaEven(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -333,6 +334,7 @@ public: CPPUNIT_TEST(testMathAverageIfsFormula); CPPUNIT_TEST(testMathCountIfsFormula); CPPUNIT_TEST(testMathFormulaCombina); + CPPUNIT_TEST(testMathFormulaEven); CPPUNIT_TEST_SUITE_END(); private: @@ -3559,6 +3561,30 @@ void ScOpenclTest::testStatisticalFormulaBetaDist() xDocSh->DoClose(); xDocShRes->DoClose(); } +//AMLOEXT-164 +void ScOpenclTest::testMathFormulaEven() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/even.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/even.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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-165] void ScOpenclTest::testMathFormulaExp() { -- cgit