diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-11-04 17:11:40 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-11 20:52:22 -0600 |
commit | cb7e9881168c33b75db4803f144d9df69990f989 (patch) | |
tree | abc519eb5f4c3eb4b9b5cce9c179410787e158c7 /sc | |
parent | 4e2e0d10ac893c6f75971255387468655b95d686 (diff) |
GPU Calc: unit test cases for WEIBULL
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-78 BUG
Change-Id: I4235313f70d2237ce06d4f71163d0d32bc0f064d
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/Weibull.xls | bin | 0 -> 7168 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/Weibull.xls b/sc/qa/unit/data/xls/opencl/statistical/Weibull.xls Binary files differnew file mode 100644 index 000000000000..e94304195fef --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/Weibull.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index d108f83f0d8b..b40689411975 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -129,6 +129,7 @@ public: void testMathFormulaTan(); void testMathFormulaTanH(); void testStatisticalFormulaStandard(); + void testStatisticalFormulaWeibull(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -189,6 +190,7 @@ public: CPPUNIT_TEST(testMathFormulaTan); CPPUNIT_TEST(testMathFormulaTanH); CPPUNIT_TEST(testStatisticalFormulaStandard); + CPPUNIT_TEST(testStatisticalFormulaWeibull); CPPUNIT_TEST_SUITE_END(); private: @@ -1386,6 +1388,31 @@ void ScOpenclTest::testStatisticalFormulaStandard() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-78] +void ScOpenclTest::testStatisticalFormulaWeibull() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Weibull.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Weibull.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i <= 20; ++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-82] void ScOpenclTest::testStatisticalFormulaPearson() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 2de1508e21bc..e72e0263bcf1 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1375,6 +1375,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocTan: case ocTanHyp: case ocStandard: + case ocWeibull: // Don't change the state. break; default: |