summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-31 14:07:16 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:20:06 -0600
commit6da394c12599cd4cfafa3a2a932a932bf0388a7e (patch)
tree534a0e96f6a6660562fcfea6cf974148f55d2061 /sc/qa/unit/opencl-test.cxx
parent2203cc63c494a9330cb4e078797b44310a684148 (diff)
GPU Calc: unit test cases for support optional parameter for STDEVPA
AMLOEXT-405 BUG Change-Id: I65cf098eefbffd5c1c838a2f4d91ba3472caf50c 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>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index eafa2283c82f..95eeb04d0599 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -292,6 +292,7 @@ public:
void testStatisticalFormulaVarA1();
void testStatisticalFormulaVarPA1();
void testStatisticalFormulaStDevA1();
+ void testStatisticalFormulaStDevPA1();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -515,6 +516,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaVarA1);
CPPUNIT_TEST(testStatisticalFormulaVarPA1);
CPPUNIT_TEST(testStatisticalFormulaStDevA1);
+ CPPUNIT_TEST(testStatisticalFormulaStDevPA1);
CPPUNIT_TEST_SUITE_END();
private:
@@ -6100,6 +6102,31 @@ void ScOpenclTest::testStatisticalFormulaStDevA1()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-405]
+void ScOpenclTest::testStatisticalFormulaStDevPA1()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevPA1.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevPA1.", 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();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{