summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/unit/data/xls/opencl/math/radians.xlsbin0 -> 23040 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
-rw-r--r--sc/source/core/tool/token.cxx1
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/radians.xls b/sc/qa/unit/data/xls/opencl/math/radians.xls
new file mode 100644
index 000000000000..a72e17d86dfd
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/radians.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index b55e088cebfa..c8e45b911e93 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -264,6 +264,7 @@ public:
void testMathFormulaRoundUp();
void testMathFormulaRoundDown();
void testMathFormulaInt();
+ void testMathFormulaRadians();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -459,6 +460,7 @@ public:
CPPUNIT_TEST(testMathFormulaRoundUp);
CPPUNIT_TEST(testMathFormulaRoundDown);
CPPUNIT_TEST(testMathFormulaInt);
+ CPPUNIT_TEST(testMathFormulaRadians);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5362,6 +5364,29 @@ void ScOpenclTest::testMathFormulaInt()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[ AMLOEXT-354]
+void ScOpenclTest::testMathFormulaRadians()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/radians.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/radians.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; i <= 9; ++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-356
void ScOpenclTest::testMathFormulaDegrees()
{
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ab5420e187c0..3feb8bee7483 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1492,6 +1492,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocRoundUp:
case ocRoundDown:
case ocInt:
+ case ocRad:
// Don't change the state.
break;
default: