diff options
author | mingli <mingli@multicorewareinc.com> | 2013-11-07 14:14:51 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 17:44:13 -0600 |
commit | 848b91fbdf668d0de0511992d8ca22911d63c0b6 (patch) | |
tree | e0fc6ad74f45216041c809ea0265d8ac25a405cf /sc | |
parent | 522393aea30a8e33b6a65e45370ce9b0aad890b8 (diff) |
GPU Calc: unit test cases for LOGNORMDIST
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-112 BUG
Change-Id: I4ab444e974499138afe330c9ccb9da640f8d3724
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/ods/opencl/statistical/LogNormDist.ods | bin | 0 -> 15340 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 27 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/statistical/LogNormDist.ods b/sc/qa/unit/data/ods/opencl/statistical/LogNormDist.ods Binary files differnew file mode 100644 index 000000000000..be191d4785bf --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/statistical/LogNormDist.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index ef51e07070c7..3283c279906a 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -174,6 +174,7 @@ public: void testMathFormulaArcTanHyp(); void testMathFormulaBitAnd(); void testStatisticalFormulaForecast(); + void testStatisticalFormulaLogNormDist(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -279,6 +280,7 @@ public: CPPUNIT_TEST(testMathFormulaArcTanHyp); CPPUNIT_TEST(testMathFormulaBitAnd); CPPUNIT_TEST(testStatisticalFormulaForecast); + CPPUNIT_TEST(testStatisticalFormulaLogNormDist); CPPUNIT_TEST_SUITE_END(); private: @@ -2374,6 +2376,31 @@ void ScOpenclTest:: testFinancialDurationFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-112] +void ScOpenclTest::testStatisticalFormulaLogNormDist() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/LogNormDist.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/LogNormDist.", ODS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i <= 19; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(4,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(4,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-113] void ScOpenclTest::testMathFormulaArcCos() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b9e9e9bd2712..7f794e5e7b0b 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1408,6 +1408,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocArcTanHyp: case ocBitAnd: case ocForecast: + case ocLogNormDist: // Don't change the state. break; default: |