diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-12-13 14:49:32 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-19 17:53:56 -0600 |
commit | 8bdde72ce452222468278f7c7f8532dca2335284 (patch) | |
tree | c2bcd0e83b150f9cc8f2eee12739f96d6d5ec2ae | |
parent | 1f8e758d96898d000901672c6c469111f8bb7625 (diff) |
GPU Calc: unit test cases for ISODD
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-361 BUG
Change-Id: Ia4a0603cf913c4e211b1b4e2eef255c4a4c8ffaa
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>
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/isodd.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 26 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 26 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/isodd.xls b/sc/qa/unit/data/xls/opencl/math/isodd.xls Binary files differnew file mode 100644 index 000000000000..80dc1c38521e --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/isodd.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 570255aeb7dc..1e7fc5e26bc2 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -267,6 +267,7 @@ public: void testMathFormulaRadians(); void testMathFormulaCountIf(); void testMathFormulaIsEven(); + void testMathFormulaIsOdd(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -465,6 +466,7 @@ public: CPPUNIT_TEST(testMathFormulaRadians); CPPUNIT_TEST(testMathFormulaCountIf); CPPUNIT_TEST(testMathFormulaIsEven); + CPPUNIT_TEST(testMathFormulaIsOdd); CPPUNIT_TEST_SUITE_END(); private: @@ -5458,7 +5460,29 @@ void ScOpenclTest::testMathFormulaCountIf() xDocSh->DoClose(); xDocShRes->DoClose(); } - +//[ AMLOEXT-361] +void ScOpenclTest::testMathFormulaIsOdd() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/isodd.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/isodd.", 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(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index b79cbbb82404..7239469b366e 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1495,6 +1495,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocRad: case ocCountIf: case ocIsEven: + case ocIsOdd: // Don't change the state. break; default: |