summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-11-16 18:04:48 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-16 23:20:12 -0600
commit48e2405de783b61882b0a103df80c5f6b3be6dd9 (patch)
tree1df143f576b9aaf6106b5819e27a50d74b38aae4 /sc/qa/unit/opencl-test.cxx
parentebd3c6c946f08ebe73785192d4e0a504717e49e5 (diff)
GPU Calc: unit test cases for TTEST
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-189 BUG Change-Id: I159a9635cb53d962fb16d82ccc2d13c2c4dc41e3 Signed-off-by: haochen <haochen@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.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index e69a0714d22d..510206b88550 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -233,6 +233,7 @@ public:
void testArrayFormulaSumX2MY2();
void testArrayFormulaSumX2PY2();
void testStatisticalFormulaBetainv();
+ void testStatisticalFormulaTTest();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -397,6 +398,7 @@ public:
CPPUNIT_TEST(testArrayFormulaSumX2MY2);
CPPUNIT_TEST(testArrayFormulaSumX2PY2);
CPPUNIT_TEST(testStatisticalFormulaBetainv);
+ CPPUNIT_TEST(testStatisticalFormulaTTest);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4377,6 +4379,31 @@ void ScOpenclTest::testStatisticalFormulaZTest()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-189]
+void ScOpenclTest::testStatisticalFormulaTTest()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/TTest.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/TTest.", 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(4,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-192]
void ScOpenclTest::testStatisticalFormulaBinomDist()
{