diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-11-08 13:01:01 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 14:09:45 -0600 |
commit | c4d4c702e11fe440c795dab5f108605eb21377a6 (patch) | |
tree | 0c3e37f9d20ffcaf3498086339477f0b1e922922 /sc | |
parent | 374f670aea4c2581c1e813c39571819fecdff4f4 (diff) |
GPU Calc: unit test cases for CHISQINV
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-148 BUG
Change-Id: If9a1c7a35220d405cdbb0d60aa2e5209c542eefb
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/CHISQINV.ods | bin | 0 -> 17130 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/ods/opencl/statistical/CHISQINV.ods b/sc/qa/unit/data/ods/opencl/statistical/CHISQINV.ods Binary files differnew file mode 100644 index 000000000000..2071bc52be2e --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/statistical/CHISQINV.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 76cf866cc6a1..b1b0ad11fc95 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -187,6 +187,7 @@ public: void testMathFormulaPower(); void testMathFormulaOdd(); void testStatisticalFormulaChiSqDist(); + void testStatisticalFormulaChiSqInv(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -305,6 +306,7 @@ public: CPPUNIT_TEST(testMathFormulaPower); CPPUNIT_TEST(testMathFormulaOdd); CPPUNIT_TEST(testStatisticalFormulaChiSqDist); + CPPUNIT_TEST(testStatisticalFormulaChiSqInv); CPPUNIT_TEST_SUITE_END(); private: @@ -3210,6 +3212,29 @@ void ScOpenclTest:: testFinacialNPER1Formula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-148] +void ScOpenclTest::testStatisticalFormulaChiSqInv() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/statistical/CHISQINV.", ODS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/CHISQINV.", ODS); + 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(2,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-149] void ScOpenclTest::testMathFormulaBitAnd() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 11c5737184c8..ae1a14fd1dc1 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1420,6 +1420,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocPower: case ocOdd: case ocChiSqDist: + case ocChiSqInv: // Don't change the state. break; default: |