summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
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 /sc/qa/unit/opencl-test.cxx
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>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx25
1 files changed, 25 insertions, 0 deletions
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()
{