summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshiming zhang <shiming@multicorewareinc.com>2013-12-16 11:27:16 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-19 17:54:00 -0600
commit49235d00f6f19bd622eba3be6f11878ac870ceca (patch)
tree7b5d62b155972d829264a9fbb5260defd5f8741d
parentc0d1d81767fcb92d04cb8eadafcd768e2ece96f3 (diff)
GPU Calc: unit test cases for VARA
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-218 BUG Change-Id: I5f779e7746b0d6f47000d79b855a188d71698b2f Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
-rw-r--r--sc/qa/unit/data/xls/opencl/statistical/VarA.xlsbin0 -> 7680 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx26
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/VarA.xls b/sc/qa/unit/data/xls/opencl/statistical/VarA.xls
new file mode 100644
index 000000000000..f83654762aff
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/statistical/VarA.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index be4a47c11f42..eac7a6012e3a 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -5022,6 +5022,32 @@ void ScOpenclTest:: testLogicalFormulaAnd()
xDocShRes->DoClose();
}
+//[AMLOEXT-218]
+void ScOpenclTest::testStatisticalFormulaVarA()
+{
+ if (!detectOpenCLDevice())
+ return;
+
+ ScDocShellRef xDocSh = loadDoc("opencl/statistical/VarA.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+
+ ScDocShellRef xDocShRes = loadDoc("opencl/statistical/VarA.", 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-245]
void ScOpenclTest::testMathFormulaSumProduct2()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 33cf32a37cb6..5245833cea78 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1498,6 +1498,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocIsOdd:
case ocFact:
case ocAverageA:
+ case ocVarA:
// Don't change the state.
break;
default: