diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-12-13 14:32:32 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:36:41 -0600 |
commit | e97cb685a565e4518af164014aa4bdc4b9cbbad9 (patch) | |
tree | 61090cf4059b1aeaa3470cc182da05354fee3229 /sc | |
parent | 6c041a172676f9512e30109e6c6768ed58679909 (diff) |
GPU Calc: unit test cases for ISEVEN
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-357 BUG
Change-Id: I58aa4c98207a3f9cafd0a2cec97f3abcca73ed33
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')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/iseven.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/iseven.xls b/sc/qa/unit/data/xls/opencl/math/iseven.xls Binary files differnew file mode 100644 index 000000000000..3e842fbc91a6 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/iseven.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 1bfb6d27c354..570255aeb7dc 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -266,6 +266,7 @@ public: void testMathFormulaInt(); void testMathFormulaRadians(); void testMathFormulaCountIf(); + void testMathFormulaIsEven(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -463,6 +464,7 @@ public: CPPUNIT_TEST(testMathFormulaInt); CPPUNIT_TEST(testMathFormulaRadians); CPPUNIT_TEST(testMathFormulaCountIf); + CPPUNIT_TEST(testMathFormulaIsEven); CPPUNIT_TEST_SUITE_END(); private: @@ -5411,6 +5413,29 @@ void ScOpenclTest::testMathFormulaDegrees() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[ AMLOEXT-357] +void ScOpenclTest::testMathFormulaIsEven() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/iseven.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/iseven.", 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-360] void ScOpenclTest::testMathFormulaCountIf() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 9930910fd320..682818092619 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1494,6 +1494,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocInt: case ocRad: case ocCountIf: + case ocIsEven: // Don't change the state. break; default: |