summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
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:20:05 -0600
commit93c0e1dfc64ffbf155cdc8fbd235d628444967b0 (patch)
tree390ee77d83eee47be257e1c3078c2b5a089c0a13 /sc/qa/unit/opencl-test.cxx
parent77373d6eabcc73312e76aa7507092b63e4770959 (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>
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 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" )
{