summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-12-24 13:39:24 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-30 15:05:26 -0600
commitc6a035a2a5259bea7da3867300471182b3e38ed2 (patch)
tree230dce247505ccabfa83f177ad77b91d102646ce
parentfb68fb3c64ae1b1a9811b7fed434dfc31015940d (diff)
GPU Calc: unit test cases for AVEDEV
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-379 BUG Change-Id: I575c5f1c2f4648232cdf4982514f0d2571fa139d 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/Avedev.xlsbin0 -> 8704 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx29
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 29 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/Avedev.xls b/sc/qa/unit/data/xls/opencl/statistical/Avedev.xls
new file mode 100644
index 000000000000..d085313dcbdf
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/Avedev.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 225e297ea17f..4103dad757f1 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -285,6 +285,7 @@ public:
void testMathFormulaSumIf();
void testAddInFormulaBesseLJ();
void testNegSub();
+ void testStatisticalFormulaAvedev();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -501,6 +502,7 @@ public:
CPPUNIT_TEST(testMathFormulaSumIf);
CPPUNIT_TEST(testAddInFormulaBesseLJ);
CPPUNIT_TEST(testNegSub);
+ CPPUNIT_TEST(testStatisticalFormulaAvedev);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5893,7 +5895,32 @@ void ScOpenclTest::testAddInFormulaBesseLJ()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-//[AMLOEXT-381]
+//AMLOEXT-379
+void ScOpenclTest::testStatisticalFormulaAvedev()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/Avedev.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Avedev.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 19; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(3,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(3,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
+
+//[AMLOEXT-383]
void ScOpenclTest::testNegSub()
{
if (!detectOpenCLDevice())
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 62e4b575ac8c..8d6ff63c21d9 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1506,6 +1506,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocSecantHyp:
case ocSumIf:
case ocNegSub:
+ case ocAveDev:
// Don't change the state.
break;
default: