summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-31 13:24:24 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:20:05 -0600
commit94f80ccf67075008af44ed39a3539c526768aad7 (patch)
treecfcfb295701043d1ff5150f734aaa0895a29e413 /sc/qa/unit/opencl-test.cxx
parent7c0f22ffd20417abde916ad08468b8230f349e8b (diff)
GPU Calc: unit test cases for support optional parameter for VARPA
AMLOEXT-403 BUG Change-Id: Ie48f1e6a6abb6dae95477902a5211729dd91ee5e 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.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 9a839899ddc6..8e14c272814a 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -290,6 +290,7 @@ public:
void testStatisticalFormulaKurt1();
void testStatisticalFormulaHarMean1();
void testStatisticalFormulaVarA1();
+ void testStatisticalFormulaVarPA1();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -511,6 +512,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaKurt1);
CPPUNIT_TEST(testStatisticalFormulaHarMean1);
CPPUNIT_TEST(testStatisticalFormulaVarA1);
+ CPPUNIT_TEST(testStatisticalFormulaVarPA1);
CPPUNIT_TEST_SUITE_END();
private:
@@ -6046,7 +6048,31 @@ void ScOpenclTest::testStatisticalFormulaVarA1()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-403]
+void ScOpenclTest::testStatisticalFormulaVarPA1()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarPA1.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarPA1.", 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" )
{