summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-12-24 12:05:27 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-30 15:05:25 -0600
commitb8bbde02a51a952ee268ed818d6201d6b5c57ec6 (patch)
tree1ad3c87b054bce8f6b6bbc1018f040562cde03fa /sc/qa/unit/opencl-test.cxx
parent97553c98546a62fc4068169db792eaf941d93fb1 (diff)
GPU Calc: unit test cases for NEGSUB
turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-383 BUG Change-Id: I6d800f22a452de063fefd02adf8da82c8920fe36 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@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.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 2be46caa69b6..225e297ea17f 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -284,6 +284,7 @@ public:
void testMathFormulaQuotient();
void testMathFormulaSumIf();
void testAddInFormulaBesseLJ();
+ void testNegSub();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -499,6 +500,7 @@ public:
CPPUNIT_TEST(testMathFormulaSeriesSum);
CPPUNIT_TEST(testMathFormulaSumIf);
CPPUNIT_TEST(testAddInFormulaBesseLJ);
+ CPPUNIT_TEST(testNegSub);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5891,6 +5893,32 @@ void ScOpenclTest::testAddInFormulaBesseLJ()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-381]
+void ScOpenclTest::testNegSub()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/math/NegSub.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/NegSub.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 0; i <= 9; ++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();
+}
+
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{