summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/unit/data/xls/opencl/math/fact.xlsbin0 -> 6656 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 25 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/fact.xls b/sc/qa/unit/data/xls/opencl/math/fact.xls
new file mode 100644
index 000000000000..ed7fbcf93c4a
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/fact.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 1e7fc5e26bc2..f4e2f91e97fb 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -268,6 +268,7 @@ public:
void testMathFormulaCountIf();
void testMathFormulaIsEven();
void testMathFormulaIsOdd();
+ void testMathFormulaFact();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -467,6 +468,7 @@ public:
CPPUNIT_TEST(testMathFormulaCountIf);
CPPUNIT_TEST(testMathFormulaIsEven);
CPPUNIT_TEST(testMathFormulaIsOdd);
+ CPPUNIT_TEST(testMathFormulaFact);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5483,6 +5485,28 @@ void ScOpenclTest::testMathFormulaIsOdd()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-362]
+void ScOpenclTest::testMathFormulaFact()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/fact.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/fact.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i <= 18; ++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();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 7239469b366e..a48545f0fc52 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1496,6 +1496,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocCountIf:
case ocIsEven:
case ocIsOdd:
+ case ocFact:
// Don't change the state.
break;
default: