summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorxinjiang <xinjiang@multicorewareinc.com>2013-11-12 11:03:49 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:26 -0600
commit8eeac26f3ef1e30357e53d75ba41a2eade47e524 (patch)
treefdc8b8d002d220a27f52ad10724d6e602b796e36 /sc/qa
parent6f6f873760647124d37e330134fb56e1ca93d6df (diff)
GPU Calc: unit test cases for DEVSQ
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-89 BUG Change-Id: I2ed2d697e9906df476271185b3ca2a2471ab3c2c 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/DevSq.xlsbin0 -> 7680 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/DevSq.xls b/sc/qa/unit/data/xls/opencl/statistical/DevSq.xls
new file mode 100644
index 000000000000..496be32fe831
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/DevSq.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 46109b6f0e1a..877dd707812d 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -220,6 +220,7 @@ public:
void testStatisticalFormulaVarP();
void testMathFormulaCeil();
void testMathFormulaKombin();
+ void testStatisticalFormulaDevSq();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -371,6 +372,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaVarP);
CPPUNIT_TEST(testMathFormulaCeil);
CPPUNIT_TEST(testMathFormulaKombin);
+ CPPUNIT_TEST(testStatisticalFormulaDevSq);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1915,6 +1917,31 @@ void ScOpenclTest::testMathFormulaCot()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-89]
+void ScOpenclTest::testStatisticalFormulaDevSq()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/DevSq.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/DevSq.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 0; i <= 11; ++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();
+}
//[AMLOEXT-90]
void ScOpenclTest::testMathFormulaCsc()
{