diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-12-31 14:00:28 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:20:05 -0600 |
commit | 93c0e1dfc64ffbf155cdc8fbd235d628444967b0 (patch) | |
tree | 390ee77d83eee47be257e1c3078c2b5a089c0a13 /sc | |
parent | 77373d6eabcc73312e76aa7507092b63e4770959 (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')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/StDevA1.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/StDevA1.xls b/sc/qa/unit/data/xls/opencl/statistical/StDevA1.xls Binary files differnew file mode 100644 index 000000000000..e17e90dddd0e --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/StDevA1.xls 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" ) { |