summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-12-17 10:02:38 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:54:04 -0600
commitdb3ff40e35216ad60c8d427415369a919c86a364 (patch)
tree19451504599412ef09efe8cad2c1a601aeb5840e /sc/qa/unit/opencl-test.cxx
parent67cd5265b2ea8f990533e46d46f7b6386a527e3a (diff)
GPU Calc: unit test cases for QUOTIENT
Need turn macro NO_FALLBACK_TO_SWINTERP on formulagroupcl.cxx for test AMLOEXT-372 BUG Change-Id: Ife2681e8c637cf8d17e3db2072f725e25ad85434 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.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 53db504d3fa8..ec7ce134b547 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -280,6 +280,7 @@ public:
void testMathFormulaSEC();
void testMathFormulaSECH();
void testMathFormulaMROUND();
+ void testMathFormulaQuotient();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -490,6 +491,7 @@ public:
CPPUNIT_TEST(testMathFormulaSEC);
CPPUNIT_TEST(testMathFormulaSECH);
CPPUNIT_TEST(testMathFormulaMROUND);
+ CPPUNIT_TEST(testMathFormulaQuotient);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5786,6 +5788,31 @@ void ScOpenclTest::testMathFormulaMROUND()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-372]
+void ScOpenclTest::testMathFormulaQuotient()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh =
+ loadDoc("opencl/math/Quotient.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes =
+ loadDoc("opencl/math/Quotient.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify BitAnd Function
+ for (SCROW i = 1; 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" )
{