diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-11-13 09:00:18 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-15 11:54:32 -0600 |
commit | a1e6bbbdaabcf37d8d8dfd89f6372e9521f36a22 (patch) | |
tree | b5db6105aba5b010734c066f02cdb77d7236177b /sc | |
parent | 2e348a2e37c702273416816122c49da90ad3bb65 (diff) |
GPU Calc: unit test cases for SUMX2PY2
Need macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-200 BUG
Change-Id: I2eb1c8b30989391d683400eef89b4543edd69f1e
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/array/SUMX2PY2.xls | bin | 0 -> 24064 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 31 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 31 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/array/SUMX2PY2.xls b/sc/qa/unit/data/xls/opencl/array/SUMX2PY2.xls Binary files differnew file mode 100644 index 000000000000..4b7ad1a83863 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/array/SUMX2PY2.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index bffd36d885d9..81fa8ebd381e 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -231,6 +231,7 @@ public: void testMathFormulaProduct(); void testStatisticalFormulaHypGeomDist(); void testArrayFormulaSumX2MY2(); + void testArrayFormulaSumX2PY2(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -393,6 +394,7 @@ public: CPPUNIT_TEST(testMathFormulaProduct); CPPUNIT_TEST(testStatisticalFormulaHypGeomDist); CPPUNIT_TEST(testArrayFormulaSumX2MY2); + CPPUNIT_TEST(testArrayFormulaSumX2PY2); CPPUNIT_TEST_SUITE_END(); private: @@ -4492,7 +4494,34 @@ void ScOpenclTest::testStatisticalFormulaHypGeomDist() xDocSh->DoClose(); xDocShRes->DoClose(); } - +//[AMLOEXT-200] +void ScOpenclTest:: testArrayFormulaSumX2PY2() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/array/SUMX2PY2.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/array/SUMX2PY2.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 9; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(2, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + for (SCROW i = 20; i <= 26; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(2, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(2, 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 38f1b13fdf2a..4c84ca4b1039 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1462,6 +1462,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocProduct: case ocHypGeomDist: case ocSumX2MY2: + case ocSumX2DY2: // Don't change the state. break; default: |