diff options
author | dechuang <dechuang@multicorewareinc.com> | 2013-11-09 10:47:36 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:46 -0600 |
commit | a8bb0352b519b37c698ee62ae785523d6bf573a1 (patch) | |
tree | b2e003b05ace38884ed760bc313b78450562689c /sc/qa | |
parent | c41db78b286fcfba1a03a29045105915f50f48b8 (diff) |
GPU Calc: unit test cases for FLOOR
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-169 BUG
Change-Id: Ib678abfdabd914eb89c712bb14fe7651c3004531
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/ods/opencl/math/floor.ods | bin | 0 -> 9086 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/floor.ods b/sc/qa/unit/data/ods/opencl/math/floor.ods Binary files differnew file mode 100644 index 000000000000..6534ea32d0a0 --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/math/floor.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index e8f55093fd5a..e754f172f06c 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -189,6 +189,7 @@ public: void testStatisticalFormulaChiSqDist(); void testStatisticalFormulaChiSqInv(); void testStatisticalFormulaGammaInv(); + void testMathFormulaFloor(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -309,6 +310,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaChiSqDist); CPPUNIT_TEST(testStatisticalFormulaChiSqInv); CPPUNIT_TEST(testStatisticalFormulaGammaInv); + CPPUNIT_TEST(testMathFormulaFloor); CPPUNIT_TEST_SUITE_END(); private: @@ -3410,6 +3412,28 @@ void ScOpenclTest::testStatisticalFormulaChiDist() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-169] +void ScOpenclTest::testMathFormulaFloor() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/floor.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/floor.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 9; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(3,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |