summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/TTest.xlsbin0 -> 8704 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/TTest.xls b/sc/qa/unit/data/xls/opencl/statistical/TTest.xls
new file mode 100644
index 000000000000..1133a62f24b0
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/TTest.xls
Binary files differ
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()
{