summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-16 11:47:11 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:54:01 -0600
commitbda58c33afe9a9f6ca4f8b27bff44ba2c22da395 (patch)
treed7a5538b3b80f0f04b2892639533aba6ddc9b66b
parent18e64e70a35b55fc37bacdff935f70bc5e851660 (diff)
GPU Calc: unit test cases for STDEVPA
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-221 BUG Change-Id: I6cfe613497a2fee5f271208b6b82db9ea753ff97 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/StDevPA.xlsbin0 -> 8704 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx31
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 27 insertions, 5 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/StDevPA.xls b/sc/qa/unit/data/xls/opencl/statistical/StDevPA.xls
new file mode 100644
index 000000000000..05b267f260eb
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/StDevPA.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 58c40e1f21be..e536dc06189f 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -276,6 +276,7 @@ public:
void testStatisticalFormulaVarA();
void testStatisticalFormulaVarPA();
void testStatisticalFormulaStDevA();
+ void testStatisticalFormulaStDevPA();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -482,6 +483,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaVarA);
CPPUNIT_TEST(testStatisticalFormulaVarPA);
CPPUNIT_TEST(testStatisticalFormulaStDevA);
+ CPPUNIT_TEST(testStatisticalFormulaStDevPA);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4975,7 +4977,6 @@ void ScOpenclTest::testMathFormulaAverageIf()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
//[AMLOEXT-216]
void ScOpenclTest::testStatisticalFormulaAverageA()
{
@@ -4998,7 +4999,6 @@ void ScOpenclTest::testStatisticalFormulaAverageA()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
//[AMLOEXT-217]
void ScOpenclTest:: testLogicalFormulaAnd()
{
@@ -5027,7 +5027,6 @@ void ScOpenclTest:: testLogicalFormulaAnd()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
//[AMLOEXT-218]
void ScOpenclTest::testStatisticalFormulaVarA()
{
@@ -5053,7 +5052,6 @@ void ScOpenclTest::testStatisticalFormulaVarA()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
//[AMLOEXT-219]
void ScOpenclTest::testStatisticalFormulaVarPA()
{
@@ -5079,7 +5077,6 @@ void ScOpenclTest::testStatisticalFormulaVarPA()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
//[AMLOEXT-220]
void ScOpenclTest::testStatisticalFormulaStDevA()
{
@@ -5105,7 +5102,31 @@ void ScOpenclTest::testStatisticalFormulaStDevA()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-221]
+void ScOpenclTest::testStatisticalFormulaStDevPA()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevPA.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevPA.", 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-245]
void ScOpenclTest::testMathFormulaSumProduct2()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 9505f464efcc..347f69691ea1 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1501,6 +1501,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocVarA:
case ocVarPA:
case ocStDevA:
+ case ocStDevPA:
// Don't change the state.
break;
default: