summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
authordechuang <dechuang@multicorewareinc.com>2013-11-12 16:37:10 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:30 -0600
commit66ded6ba639ed8f14015db88367c6451ac54eece (patch)
treebe36b84018ba98acca9a16c7f0fd5e44b40be324 /sc/qa/unit/opencl-test.cxx
parent1de904adc62c7d6cd29ecf248dbe941a51e09646 (diff)
GPU Calc: unit test cases for PRODUCT
Need macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-193 BUG Change-Id: I7d866bebf2bd3d01a8ea0643561f918581af2c93 Signed-off-by: haochen <haochen@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.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index c4d028e7bfe3..f5295badb11a 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -228,6 +228,7 @@ public:
void testMathFormulaPi();
void testMathFormulaRandom();
void testMathFormulaConvert();
+ void testMathFormulaProduct();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -387,6 +388,7 @@ public:
CPPUNIT_TEST(testMathFormulaPi);
CPPUNIT_TEST(testMathFormulaRandom);
CPPUNIT_TEST(testMathFormulaConvert);
+ CPPUNIT_TEST(testMathFormulaProduct);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4390,6 +4392,28 @@ void ScOpenclTest::testStatisticalFormulaBinomDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-193]
+void ScOpenclTest::testMathFormulaProduct()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/product.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/product.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 3; ++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();
+}
//[AMLOEXT-194]
void ScOpenclTest::testMathFormulaKombin()
{