From a7859b3c6a2710e9b1d90f040c0d31b7606b013a Mon Sep 17 00:00:00 2001 From: yiming ju Date: Thu, 12 Dec 2013 15:02:08 +0800 Subject: GPU Calc: unit test cases for ROUNDUP Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-351 BUG Change-Id: Id00cb65d9ddb7d45a1a3b7340e7acf016d3e30ef Signed-off-by: haochen Signed-off-by: Wei Wei Signed-off-by: I-Jui (Ray) Sung --- sc/qa/unit/data/xls/opencl/math/roundup.xls | Bin 0 -> 19456 bytes sc/qa/unit/opencl-test.cxx | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 sc/qa/unit/data/xls/opencl/math/roundup.xls (limited to 'sc/qa') diff --git a/sc/qa/unit/data/xls/opencl/math/roundup.xls b/sc/qa/unit/data/xls/opencl/math/roundup.xls new file mode 100644 index 000000000000..1d9505292ca0 Binary files /dev/null and b/sc/qa/unit/data/xls/opencl/math/roundup.xls differ diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index e24fca42d282..82c2a22b04d6 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -261,6 +261,7 @@ public: void testDatabaseFormulaDcount(); void testDatabaseFormulaDcountA(); void testMathFormulaDegrees(); + void testMathFormulaRoundUp(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -453,6 +454,7 @@ public: CPPUNIT_TEST(testDatabaseFormulaDcount); CPPUNIT_TEST(testDatabaseFormulaDcountA); CPPUNIT_TEST(testMathFormulaDegrees); + CPPUNIT_TEST(testMathFormulaRoundUp); CPPUNIT_TEST_SUITE_END(); private: @@ -5287,6 +5289,30 @@ void ScOpenclTest::testDatabaseFormulaDvarp() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-351] +void ScOpenclTest::testMathFormulaRoundUp() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/roundup.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/roundup.", 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-356 void ScOpenclTest::testMathFormulaDegrees() { -- cgit