diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-12-12 15:39:14 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:53:54 -0600 |
commit | 02625f20c2f5725775ee8327abc2e9ae51f23563 (patch) | |
tree | 96568ce46ea04b67c073c1f4c22407be7b667f46 /sc/qa/unit/opencl-test.cxx | |
parent | c2497c67240622984ccb3bdef2b516a9295ffa0f (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>
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
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() { |