diff options
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/roundup.xls | bin | 0 -> 19456 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 26 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/roundup.xls b/sc/qa/unit/data/xls/opencl/math/roundup.xls Binary files differnew file mode 100644 index 000000000000..1d9505292ca0 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/roundup.xls 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() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index f26652954999..ba34750adabd 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1489,6 +1489,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocDBCount: case ocDBCount2: case ocDeg: + case ocRoundUp: // Don't change the state. break; default: |