summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-11-12 14:46:33 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:27 -0600
commita9283028c255c8d76734f20269eb5aae01cb6a6d (patch)
treecdb7ac8105d0c28bf6000b89ef90698032d17d1f /sc/qa
parent7e96f4aa0b819d9e60221ece2a44eb7dc44b2b7e (diff)
GPU Calc: unit test cases for STEYX
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-187 BUG Change-Id: I23f774839d5105ebe729a1cd7df98ef22caa4b70 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/STEYX.xlsbin0 -> 8192 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/STEYX.xls b/sc/qa/unit/data/xls/opencl/statistical/STEYX.xls
new file mode 100644
index 000000000000..5deb7399fb39
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/STEYX.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 521d69e16b80..94031561d3b8 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -223,6 +223,7 @@ public:
void testStatisticalFormulaDevSq();
void testStatisticalFormulaStDev();
void testStatisticalFormulaSlope();
+ void testStatisticalFormulaSTEYX();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -377,6 +378,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaDevSq);
CPPUNIT_TEST(testStatisticalFormulaStDev);
CPPUNIT_TEST(testStatisticalFormulaSlope);
+ CPPUNIT_TEST(testStatisticalFormulaSTEYX);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4240,6 +4242,31 @@ void ScOpenclTest::testStatisticalFormulaSlope()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-187]
+void ScOpenclTest::testStatisticalFormulaSTEYX()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/STEYX.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/STEYX.", 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()
{