summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authoryangzhang <yangzhang@multicorewareinc.com>2013-11-12 10:44:22 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:26 -0600
commitd8f284c2bb4a9843aab88ea7f7f0f468962f67cd (patch)
tree79a754328a80949916a7b46123b4aea891ec8342 /sc/qa
parentedefa3bd32fd5480c4997379254fba2d5b93ce17 (diff)
GPU Calc: unit test cases for COMBIN
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-194 BUG Change-Id: I7389daf865559dd6ec0908889d1c1d6703d8e9a0 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/ods/opencl/math/Kombin.odsbin0 -> 13723 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
2 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/math/Kombin.ods b/sc/qa/unit/data/ods/opencl/math/Kombin.ods
new file mode 100644
index 000000000000..1afe524d0607
--- /dev/null
+++ b/sc/qa/unit/data/ods/opencl/math/Kombin.ods
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index d8393a63025c..46109b6f0e1a 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -219,6 +219,7 @@ public:
void testStatisticalFormulaBinomDist();
void testStatisticalFormulaVarP();
void testMathFormulaCeil();
+ void testMathFormulaKombin();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -369,6 +370,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaBinomDist);
CPPUNIT_TEST(testStatisticalFormulaVarP);
CPPUNIT_TEST(testMathFormulaCeil);
+ CPPUNIT_TEST(testMathFormulaKombin);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4180,6 +4182,29 @@ void ScOpenclTest::testStatisticalFormulaBinomDist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-194]
+void ScOpenclTest::testMathFormulaKombin()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/Kombin.", ODS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/Kombin.", ODS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Verify Combin 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" )
{