diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-11-17 12:04:32 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-16 23:20:20 -0600 |
commit | f7e6521efca5e5966a65e84848a1c35d71ba1a0b (patch) | |
tree | 76ab9adb32475d51e11fef2ccf02b21ef88923e1 /sc/qa | |
parent | e57f015669d1a50e23347915613adcb8b42ea564 (diff) |
GPU Calc: unit test cases for COVAR
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-86 BUG
Change-Id: Ie35b4fe1efcdd21e8488ce560c30bd3fca6aa30c
Signed-off-by: haochen <haochen@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/Covar.xls | bin | 0 -> 8192 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/Covar.xls b/sc/qa/unit/data/xls/opencl/statistical/Covar.xls Binary files differnew file mode 100644 index 000000000000..fc559b0d50c3 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/Covar.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index cebdfa2909bf..07828836557e 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -238,6 +238,7 @@ public: void testStatisticalFormulaTInv(); void testArrayFormulaSumXMY2(); void testStatisticalFormulaStDevP(); + void testStatisticalFormulaCovar(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -407,6 +408,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaTInv); CPPUNIT_TEST(testArrayFormulaSumXMY2); CPPUNIT_TEST(testStatisticalFormulaStDevP); + CPPUNIT_TEST(testStatisticalFormulaCovar); CPPUNIT_TEST_SUITE_END(); private: @@ -1951,6 +1953,31 @@ void ScOpenclTest::testMathFormulaCosh() xDocSh->DoClose(); xDocShRes->DoClose(); } +void ScOpenclTest::testStatisticalFormulaCovar() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Covar.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Covar.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 0; i <= 16; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(2,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(2,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} + //[AMLOEXT-87] void ScOpenclTest::testStatisticalFormulaKurt() { |