summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authordechuang <dechuang@multicorewareinc.com>2013-12-11 12:06:20 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:53:43 -0600
commitba37ee005c75a196f5275416ab9118e7e60a6299 (patch)
tree313aa3bdf38821034019df27e1913ba366f39ca9 /sc/qa/unit/opencl-test.cxx
parentaf1ac453dfb6041ba04a50117a481739c10307ab (diff)
GPU Calc: unit test cases for DMIN
Need turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-336 BUG Change-Id: I144f5f3fc7b8ec629cb24e7fa103578f163a2654 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 44434b7fb54d..211dc3ee8824 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -249,6 +249,7 @@ public:
void testLogicalFormulaNot();
void testLogicalFormulaXor();
void testDatabaseFormulaDmax();
+ void testDatabaseFormulaDmin();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -429,6 +430,7 @@ public:
CPPUNIT_TEST(testLogicalFormulaNot);
CPPUNIT_TEST(testLogicalFormulaXor);
CPPUNIT_TEST(testDatabaseFormulaDmax);
+ CPPUNIT_TEST(testDatabaseFormulaDmin);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4998,6 +5000,32 @@ void ScOpenclTest::testDatabaseFormulaDmax()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+
+//[AMLOEXT-336]
+void ScOpenclTest::testDatabaseFormulaDmin()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/database/dmin.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/database/dmin.", 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" )
{