summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-12-04 10:31:30 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:18 -0600
commit2690e5e849d79b283992dd4def357c47e74b4068 (patch)
tree8d635e3f1bf2215a610918fb3749b8bf7d70a460 /sc/qa/unit/opencl-test.cxx
parent8c415e9e85edb4c59a9c2d6cc9575b0cfe0c78e8 (diff)
GPU Calc: unit test cases for OR
Need turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-264 BUG Change-Id: I6d826bf53b801e2270734bf5bf7f38095ff0d2b0 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> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index e1f435e8f73b..d926a152d7f7 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -241,6 +241,7 @@ public:
void testStatisticalFormulaStDevP();
void testStatisticalFormulaCovar();
void testLogicalFormulaAnd();
+ void testLogicalFormulaOr();
void testMathFormulaSumProduct();
void testMathFormulaSumProduct2();
void testStatisticalParallelCountBug();
@@ -421,6 +422,7 @@ public:
CPPUNIT_TEST(testMathFormulaSumProduct2);
CPPUNIT_TEST(testStatisticalParallelCountBug);
CPPUNIT_TEST(testSpreadSheetFormulaVLookup);
+ CPPUNIT_TEST(testLogicalFormulaOr);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4902,7 +4904,28 @@ void ScOpenclTest:: testStatisticalParallelCountBug()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
+//[AMLOEXT-264]
+void ScOpenclTest:: testLogicalFormulaOr()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/logical/or.", XLS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/logical/or.", XLS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i < 20; ++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" )
{