summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-16 11:43:07 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:54:01 -0600
commitbe226d2082fec312f1888cc93dbf68bc98ef1f4a (patch)
tree47b969459801bcd0d4df650bdab86b4de5693a94
parent07566812ebf152dfc760091ab391bc89c993c4d7 (diff)
GPU Calc: unit test cases for STDEVA
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-220 BUG Change-Id: Id31a9bbaf0bdb5323190168a498ddf126d2fb6e4 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/StDevA.xlsbin0 -> 8704 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx28
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/StDevA.xls b/sc/qa/unit/data/xls/opencl/statistical/StDevA.xls
new file mode 100644
index 000000000000..4c0721f7fd7e
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/StDevA.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 20f6b3bc7243..58c40e1f21be 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -275,6 +275,7 @@ public:
void testStatisticalFormulaAverageA();
void testStatisticalFormulaVarA();
void testStatisticalFormulaVarPA();
+ void testStatisticalFormulaStDevA();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -480,6 +481,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaAverageA);
CPPUNIT_TEST(testStatisticalFormulaVarA);
CPPUNIT_TEST(testStatisticalFormulaVarPA);
+ CPPUNIT_TEST(testStatisticalFormulaStDevA);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5078,6 +5080,32 @@ void ScOpenclTest::testStatisticalFormulaVarPA()
xDocShRes->DoClose();
}
+//[AMLOEXT-220]
+void ScOpenclTest::testStatisticalFormulaStDevA()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevA.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevA.", 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 0dd946d1d63a..9505f464efcc 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1500,6 +1500,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocAverageA:
case ocVarA:
case ocVarPA:
+ case ocStDevA:
// Don't change the state.
break;
default: