diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-12-12 15:02:08 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:53:52 -0600 |
commit | a7859b3c6a2710e9b1d90f040c0d31b7606b013a (patch) | |
tree | 201c8589d00df12f50d95d957c945630116a91c0 /sc/qa | |
parent | f7c7805c434646189646e689c9c45faa2b30a756 (diff) |
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 <haochen@multicorewareinc.com>
Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-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 |
2 files changed, 26 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() { |