diff options
author | yangzhang <yangzhang@multicorewareinc.com> | 2013-12-17 11:53:13 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:54:04 -0600 |
commit | 0016999b43fe9b3b60dda68132668c9b174d2598 (patch) | |
tree | 1de2a3aef4ecd03adac967d2d2ed7c6ee32127c7 | |
parent | 14294525adf96f3da84f434e4a949332e6bab31d (diff) |
GPU Calc: unit test cases for SERIESSUM
Need turn macro NO_FALLBACK_TO_SWINTERP on formulagroupcl.cxx for test
AMLOEXT-373 BUG
Change-Id: Id30d16c46d33e18f347682946f18b5c82aef2158
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/seriessum.xls | bin | 0 -> 7680 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/xls/opencl/math/seriessum.xls b/sc/qa/unit/data/xls/opencl/math/seriessum.xls Binary files differnew file mode 100644 index 000000000000..14104ac0e2c1 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/seriessum.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index ec7ce134b547..9704e7f2b1bd 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -280,6 +280,7 @@ public: void testMathFormulaSEC(); void testMathFormulaSECH(); void testMathFormulaMROUND(); + void testMathFormulaSeriesSum(); void testMathFormulaQuotient(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); @@ -492,6 +493,7 @@ public: CPPUNIT_TEST(testMathFormulaSECH); CPPUNIT_TEST(testMathFormulaMROUND); CPPUNIT_TEST(testMathFormulaQuotient); + CPPUNIT_TEST(testMathFormulaSeriesSum); CPPUNIT_TEST_SUITE_END(); private: @@ -5813,6 +5815,28 @@ void ScOpenclTest::testMathFormulaQuotient() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-373] +void ScOpenclTest::testMathFormulaSeriesSum() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/seriessum.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/seriessum.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |