summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-11-11 17:36:28 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-15 11:54:24 -0600
commit5fd9b52dd48d932ce652c9ef1084e033ea755493 (patch)
treea72510e0aee164777f493aeb3c050ccda3f48b72 /sc/qa
parent31cc96c55160786d1af7bedcc0d010f954610b58 (diff)
GPU Calc: unit test cases for VARP
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-183 BUG Change-Id: I230d2a0ee9ee5286cb631f7401a42438f51e67d7 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/VarP.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx27
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/VarP.xls b/sc/qa/unit/data/xls/opencl/statistical/VarP.xls
new file mode 100644
index 000000000000..3263ffb4d7be
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/VarP.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 8a4eaf94d04c..d64f1f53d09f 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -217,6 +217,7 @@ public:
void testStatisticalFormulaSkewp();
void testMathFormulaSqrtPi();
void testStatisticalFormulaBinomDist();
+ void testStatisticalFormulaVarP();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -365,6 +366,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaSkewp);
CPPUNIT_TEST(testMathFormulaSqrtPi);
CPPUNIT_TEST(testStatisticalFormulaBinomDist);
+ CPPUNIT_TEST(testStatisticalFormulaVarP);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4103,6 +4105,31 @@ void ScOpenclTest::testMathFormulaSqrtPi()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-183]
+void ScOpenclTest::testStatisticalFormulaVarP()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarP.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarP.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 20; ++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-192]
void ScOpenclTest::testStatisticalFormulaBinomDist()
{