diff options
author | mulei <mulei@multicorewareinc.com> | 2013-12-16 12:02:33 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:54:03 -0600 |
commit | 436fe90db05317e31c855e1ea01b3c4263784f07 (patch) | |
tree | a615200db2cf349f599ae29a3aae3132b6476239 | |
parent | c658befebe5c9ca25a6d73006ec92e6d3859bf73 (diff) |
GPU Calc: unit test cases for MROUND
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-369 BUG
Change-Id: If0bf63873afdd3b2bbf302a3fe58621f5853ba1d
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>
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/MROUND.xls | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/MROUND.xls b/sc/qa/unit/data/xls/opencl/math/MROUND.xls Binary files differnew file mode 100644 index 000000000000..5aeabf3a5cac --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/MROUND.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 293a6fe721e7..53db504d3fa8 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -279,6 +279,7 @@ public: void testStatisticalFormulaStDevPA(); void testMathFormulaSEC(); void testMathFormulaSECH(); + void testMathFormulaMROUND(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -488,6 +489,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaStDevPA); CPPUNIT_TEST(testMathFormulaSEC); CPPUNIT_TEST(testMathFormulaSECH); + CPPUNIT_TEST(testMathFormulaMROUND); CPPUNIT_TEST_SUITE_END(); private: @@ -5761,6 +5763,29 @@ void ScOpenclTest::testMathFormulaSECH() xDocSh->DoClose(); xDocShRes->DoClose(); } +//AMLOEXT-369 +void ScOpenclTest::testMathFormulaMROUND() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/MROUND.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/MROUND.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 13; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(2,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |