summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-11-12 17:18:50 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:31 -0600
commit67e2b033b1ba0938f294e853b98ce748e0fb1fa5 (patch)
tree0faaec43886968fee32da0a4f30dac39eed0278f /sc/qa/unit/opencl-test.cxx
parentd470a9f978198812466832acf81ff0128c856da3 (diff)
GPU Calc: unit test cases for SUMX2MY2
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-198 BUG Change-Id: I8d3817c990b07310be31b3246af1b58b960c62d1 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.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 7afe2d52032e..bffd36d885d9 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -230,6 +230,7 @@ public:
void testMathFormulaConvert();
void testMathFormulaProduct();
void testStatisticalFormulaHypGeomDist();
+ void testArrayFormulaSumX2MY2();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -391,6 +392,7 @@ public:
CPPUNIT_TEST(testMathFormulaConvert);
CPPUNIT_TEST(testMathFormulaProduct);
CPPUNIT_TEST(testStatisticalFormulaHypGeomDist);
+ CPPUNIT_TEST(testArrayFormulaSumX2MY2);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4439,6 +4441,34 @@ void ScOpenclTest::testMathFormulaKombin()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-198]
+void ScOpenclTest:: testArrayFormulaSumX2MY2()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/array/SUMX2MY2.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMX2MY2.", 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();
+}
//[AMLOEXT-199]
void ScOpenclTest::testStatisticalFormulaHypGeomDist()
{
@@ -4462,6 +4492,7 @@ void ScOpenclTest::testStatisticalFormulaHypGeomDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{