diff options
author | hongyu zhong <hongyu@multicorewareinc.com> | 2013-11-05 16:24:19 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 00:45:06 -0600 |
commit | 5ef8c443c594e3b6a4553e6c9e18fde2c6381f0f (patch) | |
tree | a3c684bf09a15716c0a9ea92f82c14a525a7c0ab | |
parent | GPU Calc: implemented NORMDIST (diff) | |
download | core-5ef8c443c594e3b6a4553e6c9e18fde2c6381f0f.tar.gz core-5ef8c443c594e3b6a4553e6c9e18fde2c6381f0f.zip |
GPU Calc: unit test cases for NORMDIST
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-101 BUG
Change-Id: I794119f51940b10f45be320bd179c6383b97c953
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/Normdist.xls | bin | 0 -> 8192 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/Normdist.xls b/sc/qa/unit/data/xls/opencl/statistical/Normdist.xls Binary files differnew file mode 100644 index 000000000000..a9f2e0777947 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/Normdist.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index e6470f4af90d..cb28368fa0f4 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -141,6 +141,7 @@ public: void testFinancialVDBFormula(); void testStatisticalFormulaKurt(); void testFinacialNPERFormula(); + void testStatisticalFormulaNormdist(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -213,6 +214,7 @@ public: CPPUNIT_TEST(testFinancialVDBFormula); CPPUNIT_TEST(testStatisticalFormulaKurt); CPPUNIT_TEST(testFinacialNPERFormula); + CPPUNIT_TEST(testStatisticalFormulaNormdist); CPPUNIT_TEST_SUITE_END(); private: @@ -1622,6 +1624,29 @@ void ScOpenclTest::testStatisticalFormulaMedian() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-101] +void ScOpenclTest::testStatisticalFormulaNormdist() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Normdist.",XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Normdist.",XLS); + 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-108] void ScOpenclTest::testFinacialNPERFormula() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 80a1236c61ab..73a6a9499682 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1382,6 +1382,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocVBD: case ocKurt: case ocZZR: + case ocNormDist: // Don't change the state. break; default: |