summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-11-09 11:30:13 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-11-14 14:09:48 -0600
commit58d21c5cae73893a04a51f3f271bfe7f923b1c3d (patch)
treead229caec5ac3c199f223832e1df39758cfd4074
parent2b183e296940f19bb195ba967e09589d60f7cf40 (diff)
GPU Calc: unit test cases for B
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-161 BUG Change-Id: Ie40900785702c20b45dc6c60600d11822d46c2e6 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/B.xlsbin0 -> 9728 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx28
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/B.xls b/sc/qa/unit/data/xls/opencl/statistical/B.xls
new file mode 100644
index 000000000000..06952c47a610
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/B.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index b597ed081dc1..d1aa95cbf2a9 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -192,6 +192,7 @@ public:
void testMathFormulaFloor();
void testStatisticalFormulaFInv();
void testStatisticalFormulaFTest();
+ void testStatisticalFormulaB();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -315,6 +316,7 @@ public:
CPPUNIT_TEST(testMathFormulaFloor);
CPPUNIT_TEST(testStatisticalFormulaFInv);
CPPUNIT_TEST(testStatisticalFormulaFTest);
+ CPPUNIT_TEST(testStatisticalFormulaB);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3444,6 +3446,32 @@ void ScOpenclTest::testStatisticalFormulaFTest()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-161]
+void ScOpenclTest::testStatisticalFormulaB()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/B.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/B.", 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(4,i,0));
+ double fExcel = pDocRes->GetValue(ScAddress(4,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ fLibre = pDoc->GetValue(ScAddress(5,i,0));
+ fExcel = pDocRes->GetValue(ScAddress(5,i,0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
//[AMLOEXT-166]
void ScOpenclTest::testStatisticalFormulaChiDist()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index c0bb7fdbd97d..b1b1de3fee18 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1425,6 +1425,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocFloor:
case ocFInv:
case ocFTest:
+ case ocB:
// Don't change the state.
break;
default: