From 030b1a42a6dc5a98c78151127adb9b41a8a773fd Mon Sep 17 00:00:00 2001 From: yiming ju Date: Thu, 12 Dec 2013 15:39:14 +0800 Subject: 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 Signed-off-by: Wei Wei Signed-off-by: I-Jui (Ray) Sung Signed-off-by: Wei Wei --- sc/qa/unit/opencl-test.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'sc/qa/unit/opencl-test.cxx') 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() { -- cgit