diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-12-31 14:07:16 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:20:06 -0600 |
commit | 6da394c12599cd4cfafa3a2a932a932bf0388a7e (patch) | |
tree | 534a0e96f6a6660562fcfea6cf974148f55d2061 /sc/qa | |
parent | 2203cc63c494a9330cb4e078797b44310a684148 (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')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/StDevPA1.xls | bin | 0 -> 7680 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/StDevPA1.xls b/sc/qa/unit/data/xls/opencl/statistical/StDevPA1.xls Binary files differnew file mode 100644 index 000000000000..e9c99571e35b --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/StDevPA1.xls 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" ) { |