diff options
author | xinjiang <xinjiang@multicorewareinc.com> | 2013-11-06 17:14:02 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-13 17:44:09 -0600 |
commit | fd911a92d1e1b022fd652a1740b1d0b524054412 (patch) | |
tree | 6cc0949ac68108fbad51b14929f7b3bd5608d09a /sc | |
parent | efc507cebc00051f7288fd0e017b4caec1c407b7 (diff) |
GPU Calc: unit test cases for CRITBINOM
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-142 BUG
Change-Id: I8528df9d89dc21ae9e3fade580c0631764d74c43
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/xls/opencl/statistical/CritBinom.xls | bin | 0 -> 6656 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/xls/opencl/statistical/CritBinom.xls b/sc/qa/unit/data/xls/opencl/statistical/CritBinom.xls Binary files differnew file mode 100644 index 000000000000..eb02321030b7 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/CritBinom.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 9c2cc164774d..e970b1f027ea 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -166,6 +166,7 @@ public: void testStatisticalFormulaLogInv(); void testMathFormulaArcCot(); void testMathFormulaCosh(); + void testStatisticalFormulaCritBinom(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -263,6 +264,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaLogInv); CPPUNIT_TEST(testMathFormulaArcCot); CPPUNIT_TEST(testMathFormulaCosh); + CPPUNIT_TEST(testStatisticalFormulaCritBinom); CPPUNIT_TEST_SUITE_END(); private: @@ -2802,6 +2804,31 @@ void ScOpenclTest::testFinancialAccrintFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-142] +void ScOpenclTest::testStatisticalFormulaCritBinom() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/CritBinom.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CritBinom.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + 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" ) { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index dd097c6e4190..cc60e23d9144 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1400,6 +1400,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocLogInv: case ocArcCot: case ocCosHyp: + case ocKritBinom: // Don't change the state. break; default: |