summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorhongyu zhong <hongyu@multicorewareinc.com>2013-11-06 11:34:41 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-13 14:39:17 -0600
commit152f8d40c7d5acabe253abd22d1d6a099cfeab28 (patch)
tree68474b3846c33f3949aa3ffc104180537b1b9152 /sc/qa
parent03cc4ca5c448c2600828020e9ef2313468f6e0b2 (diff)
GPU Calc: unit test cases for PERMUT
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-103 BUG Change-Id: I0dc685857dc87f1d87c1258b93d66d9ef67e26f2 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/xls/opencl/statistical/Permut.xlsbin0 -> 7168 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx26
2 files changed, 25 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/Permut.xls b/sc/qa/unit/data/xls/opencl/statistical/Permut.xls
new file mode 100644
index 000000000000..933852819c48
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/Permut.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index fa5ab3ae7787..941e43d8106b 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -150,6 +150,7 @@ public:
void testStatisticalFormulaNormsdist();
void testStatisticalFormulaNorminv();
void testStatisticalFormulaNormsinv();
+ void testStatisticalFormulaPermut();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -231,6 +232,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaNormsdist);
CPPUNIT_TEST(testStatisticalFormulaNorminv);
CPPUNIT_TEST(testStatisticalFormulaNormsinv);
+ CPPUNIT_TEST(testStatisticalFormulaPermut);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1708,7 +1710,29 @@ void ScOpenclTest::testStatisticalFormulaNormsdist()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
+//[AMLOEXT-103]
+void ScOpenclTest::testStatisticalFormulaPermut()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/Permut.",XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Permut.",XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 19; ++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();
+}
//[AMLOEXT-108]
void ScOpenclTest::testFinacialNPERFormula()
{