diff options
author | hongyu zhong <hongyu@multicorewareinc.com> | 2013-11-04 17:31:04 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-11 20:52:23 -0600 |
commit | 62ee42a209dfd4862cab9311868f4f38a6e000ac (patch) | |
tree | 40c7a8d4c878a141b22dbdc385886dd32343e836 | |
parent | eb2c6bd19faca2607fa425bbd7f8a95f5407a1ac (diff) |
GPU Calc: unit test cases for MEDIAN
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-100 BUG
Change-Id: Idbc6a697c42b639a310200b4df9eb35ba5e8eca7
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/Median.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/Median.xls b/sc/qa/unit/data/xls/opencl/statistical/Median.xls Binary files differnew file mode 100644 index 000000000000..232629e163a4 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/Median.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index b40689411975..b593174bc73e 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -130,6 +130,7 @@ public: void testMathFormulaTanH(); void testStatisticalFormulaStandard(); void testStatisticalFormulaWeibull(); + void testStatisticalFormulaMedian(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -191,6 +192,7 @@ public: CPPUNIT_TEST(testMathFormulaTanH); CPPUNIT_TEST(testStatisticalFormulaStandard); CPPUNIT_TEST(testStatisticalFormulaWeibull); + CPPUNIT_TEST(testStatisticalFormulaMedian); CPPUNIT_TEST_SUITE_END(); private: @@ -1532,6 +1534,29 @@ void ScOpenclTest:: testFinancialISPMTFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-100] +void ScOpenclTest::testStatisticalFormulaMedian() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Median.",XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Median.",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(); +} void ScOpenclTest::testFinacialPriceMatFormula() { if (!detectOpenCLDevice()) diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index e72e0263bcf1..1bcf7262a1b7 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1376,6 +1376,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocTanHyp: case ocStandard: case ocWeibull: + case ocMedian: // Don't change the state. break; default: |