diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-11-12 13:36:34 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-15 11:54:27 -0600 |
commit | 0d57113267b5cc18632c7ea0e1c1ea4e446a8af2 (patch) | |
tree | 7d9dda4685db3e14bb61331b1bc1055fa885b71a /sc/qa | |
parent | cfbdb1e40030c58f7674cb293b8984d1d129a2cb (diff) |
GPU Calc: unit test cases for SLOPE
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-186 BUG
Change-Id: I802de8aa311887ac63fc76fe4e9441678d79e5fb
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/Slope.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/Slope.xls b/sc/qa/unit/data/xls/opencl/statistical/Slope.xls Binary files differnew file mode 100644 index 000000000000..1ba210eb02be --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/Slope.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index e5f4e1b67219..521d69e16b80 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -222,6 +222,7 @@ public: void testMathFormulaKombin(); void testStatisticalFormulaDevSq(); void testStatisticalFormulaStDev(); + void testStatisticalFormulaSlope(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -375,6 +376,7 @@ public: CPPUNIT_TEST(testMathFormulaKombin); CPPUNIT_TEST(testStatisticalFormulaDevSq); CPPUNIT_TEST(testStatisticalFormulaStDev); + CPPUNIT_TEST(testStatisticalFormulaSlope); CPPUNIT_TEST_SUITE_END(); private: @@ -4213,6 +4215,31 @@ void ScOpenclTest::testStatisticalFormulaStDev() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-186] +void ScOpenclTest::testStatisticalFormulaSlope() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Slope.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Slope.", 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(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-192] void ScOpenclTest::testStatisticalFormulaBinomDist() { |