summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-11-17 11:16:38 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-16 23:20:17 -0600
commitee8ecaa0de377a7cb698c3e52d027778d315fb28 (patch)
treeda99411f4bc06a392583aa49cdfbd6a0e71aff38 /sc/qa/unit/opencl-test.cxx
parent4fc3fbb2f761b500542dde37a7bc01b4cac109a7 (diff)
GPU Calc: unit test cases for SUMXMY2
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-204 BUG Change-Id: Ie9c124ecf8d88915e037c0f36f8e46c4e0e97801 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.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 228f6b6893c3..20673a790291 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -236,6 +236,7 @@ public:
void testStatisticalFormulaTTest();
void testStatisticalFormulaTDist();
void testStatisticalFormulaTInv();
+ void testArrayFormulaSumXMY2();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -403,6 +404,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaTTest);
CPPUNIT_TEST(testStatisticalFormulaTDist);
CPPUNIT_TEST(testStatisticalFormulaTInv);
+ CPPUNIT_TEST(testArrayFormulaSumXMY2);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4628,6 +4630,34 @@ void ScOpenclTest::testStatisticalFormulaBetainv()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[ AMLOEXT-204]
+void ScOpenclTest:: testArrayFormulaSumXMY2()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/array/SUMXMY2.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMXMY2.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 9; ++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));
+ }
+ for (SCROW i = 20; i <= 26; ++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();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{