summaryrefslogtreecommitdiff
path: root/sc
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:36:58 -0600
commit8eacfeda44c6d28aa3170e73a73de893b419d6f8 (patch)
tree6b962897a3173fea4a9a10088a5d3329ce3bbd3d /sc
parent8b3632fbeeb1dbb297dd2c5c3c7c676448a3a25a (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> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/VarPA1.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/VarPA1.xls b/sc/qa/unit/data/xls/opencl/statistical/VarPA1.xls
new file mode 100644
index 000000000000..dc0909332c3e
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/VarPA1.xls
Binary files differ
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" )
{