summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-11-11 10:38:49 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 20:30:54 -0600
commit384d21b87e69ba8926d40421dc45f61a011fb089 (patch)
tree27c782f4384cd204e0f8ae285337fc5a13713029
parent83db53e58720a4ff01e4400d87707121347df7b0 (diff)
GPU Calc: unit test cases for SKEWP
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-81 BUG Change-Id: I53e181c967b1ce7b2735539f4f714c9a7719cb7a 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/Skewp.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/Skewp.xls b/sc/qa/unit/data/xls/opencl/statistical/Skewp.xls
new file mode 100644
index 000000000000..deeca27e465a
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/Skewp.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 9cf3cbd9448a..648b2bc14461 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -214,6 +214,7 @@ public:
void testStatisticalFormulaChiInv();
void testStatisticalFormulaPoisson();
void testMathFormulaSumSQ();
+ void testStatisticalFormulaSkewp();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -359,6 +360,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaChiInv);
CPPUNIT_TEST(testStatisticalFormulaPoisson);
CPPUNIT_TEST(testMathFormulaSumSQ);
+ CPPUNIT_TEST(testStatisticalFormulaSkewp);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1741,6 +1743,31 @@ void ScOpenclTest::testStatisticalFormulaSkew()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-81]
+void ScOpenclTest::testStatisticalFormulaSkewp()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/Skewp.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Skewp.", 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(1,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(1,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 14cd9879fb85..3d99294cb672 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1446,6 +1446,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocChiInv:
case ocPoissonDist:
case ocSumSQ:
+ case ocSkewp:
// Don't change the state.
break;
default: