diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-12-31 13:00:43 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:20:03 -0600 |
commit | 28759cea9eecd2be14028ebbd76d48031070e663 (patch) | |
tree | be516a619580b692a221d1a34df174895bd304f6 /sc/qa/unit/opencl-test.cxx | |
parent | 076a2d991a59ffb2d22bb056010c8f3dcc3007f1 (diff) |
GPU Calc: unit test cases for support optional parameter for VARA
AMLOEXT-402 BUG
Change-Id: If6f4064d3e706957cc1db0c668f42675642455c3
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.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 98e8917b4e1b..9a839899ddc6 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -289,6 +289,7 @@ public: void testMathFormulaAverageIf_Mix(); void testStatisticalFormulaKurt1(); void testStatisticalFormulaHarMean1(); + void testStatisticalFormulaVarA1(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -509,6 +510,7 @@ public: CPPUNIT_TEST(testMathFormulaAverageIf_Mix); CPPUNIT_TEST(testStatisticalFormulaKurt1); CPPUNIT_TEST(testStatisticalFormulaHarMean1); + CPPUNIT_TEST(testStatisticalFormulaVarA1); CPPUNIT_TEST_SUITE_END(); private: @@ -6019,6 +6021,32 @@ void ScOpenclTest::testStatisticalFormulaHarMean1() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-402] +void ScOpenclTest::testStatisticalFormulaVarA1() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarA1.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarA1.", 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" ) { |