summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-12-12 15:39:14 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:39 -0600
commit030b1a42a6dc5a98c78151127adb9b41a8a773fd (patch)
tree6540174d7aa09e889a870b02d4242bb80ef78ecf
parent81aa78a9a776ab48411fdb85ff9868806de129f0 (diff)
GPU Calc: unit test cases for RADIANS
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test AMLOEXT-354 BUG Change-Id: Id127970a88bfa78c01c2dbdfba8fdc707eb5a9f8 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> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
-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: