diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-12-31 13:24:24 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:20:05 -0600 |
commit | 94f80ccf67075008af44ed39a3539c526768aad7 (patch) | |
tree | cfcfb295701043d1ff5150f734aaa0895a29e413 /sc | |
parent | 7c0f22ffd20417abde916ad08468b8230f349e8b (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')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/statistical/VarPA1.xls | bin | 0 -> 7680 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 26 |
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 Binary files differnew file mode 100644 index 000000000000..dc0909332c3e --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/VarPA1.xls 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" ) { |