summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authordechuang <dechuang@multicorewareinc.com>2013-12-11 14:03:00 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:32 -0600
commit2253881dfef960c87c335f962ce194851a85a115 (patch)
tree9070bab89004a29b097bfb345934f7f43250d36f /sc/qa/unit/opencl-test.cxx
parent5dcbf937a7af75e19574f46541528a5f9be0f075 (diff)
GPU Calc: unit test cases for DPRODUCT
Need turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-337 BUG Change-Id: I579f9811f7be250cb94593bdfff312b552f65b13 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.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 211dc3ee8824..077b966f0478 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -250,6 +250,7 @@ public:
void testLogicalFormulaXor();
void testDatabaseFormulaDmax();
void testDatabaseFormulaDmin();
+ void testDatabaseFormulaDproduct();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -431,6 +432,7 @@ public:
CPPUNIT_TEST(testLogicalFormulaXor);
CPPUNIT_TEST(testDatabaseFormulaDmax);
CPPUNIT_TEST(testDatabaseFormulaDmin);
+ CPPUNIT_TEST(testDatabaseFormulaDproduct);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5025,6 +5027,31 @@ void ScOpenclTest::testDatabaseFormulaDmin()
xDocShRes->DoClose();
}
+//[AMLOEXT-337]
+void ScOpenclTest::testDatabaseFormulaDproduct()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/database/dproduct.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/database/dproduct.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 32; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(9,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(10,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.00000000001));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
+
+
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )