diff options
author | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-22 11:38:21 -0600 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-22 11:50:09 -0600 |
commit | 1869c062c4fe8267323764e2cc9e7367e1ec3674 (patch) | |
tree | 9b52e1452d19d27922803098e00dd29fcd0e9653 /sc | |
parent | 8b9c106064b6899e4bb4a86efb8906eef758c5bf (diff) |
GPU Calc: test case for parallel count()
AMLOEXT-243 BUG
Change-Id: I97e2dab35b40f4f7fcd4975ae7c5907e97e19fd9
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods | bin | 0 -> 22925 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods b/sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods Binary files differnew file mode 100644 index 000000000000..4a8d5f927571 --- /dev/null +++ b/sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 3f02d9bdd0d0..faf2ddbbf9dd 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -242,6 +242,7 @@ public: void testStatisticalFormulaCovar(); void testLogicalFormulaAnd(); void testMathFormulaSumProduct(); + void testStatisticalParallelCountBug(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -415,6 +416,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaCovar); CPPUNIT_TEST(testLogicalFormulaAnd); CPPUNIT_TEST(testMathFormulaSumProduct); + CPPUNIT_TEST(testStatisticalParallelCountBug); CPPUNIT_TEST_SUITE_END(); private: @@ -4818,6 +4820,32 @@ void ScOpenclTest:: testLogicalFormulaAnd() xDocSh->DoClose(); xDocShRes->DoClose(); } + +//[AMLOEXT-243] +void ScOpenclTest:: testStatisticalParallelCountBug() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = + loadDoc("opencl/statistical/parallel_count_bug_243.", ODS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = + loadDoc("opencl/statistical/parallel_count_bug_243.", ODS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i < 13; ++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" ) { |