summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-31 14:00:28 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:59 -0600
commit8893db1f6af0a79f00085b3386c74de640f7cbba (patch)
tree4359a504fdbafd6c254c3224ff399333d864d969 /sc
parent237bd7f1ac640a2eecf533ecc0d3a735b6bc5131 (diff)
GPU Calc: unit test cases for support optional parameter for STDEVA
AMLOEXT-404 BUG Change-Id: I7dfbbecee5f178a42b28d9df0f4f205fa694d152 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> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/StDevA1.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/StDevA1.xls b/sc/qa/unit/data/xls/opencl/statistical/StDevA1.xls
new file mode 100644
index 000000000000..e17e90dddd0e
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/StDevA1.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 8e14c272814a..eafa2283c82f 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -291,6 +291,7 @@ public:
void testStatisticalFormulaHarMean1();
void testStatisticalFormulaVarA1();
void testStatisticalFormulaVarPA1();
+ void testStatisticalFormulaStDevA1();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -513,6 +514,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaHarMean1);
CPPUNIT_TEST(testStatisticalFormulaVarA1);
CPPUNIT_TEST(testStatisticalFormulaVarPA1);
+ CPPUNIT_TEST(testStatisticalFormulaStDevA1);
CPPUNIT_TEST_SUITE_END();
private:
@@ -6073,6 +6075,31 @@ void ScOpenclTest::testStatisticalFormulaVarPA1()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-404]
+void ScOpenclTest::testStatisticalFormulaStDevA1()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/StDevA1.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/StDevA1.", 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" )
{