diff options
author | minwang <min@multicorewareinc.com> | 2013-11-17 14:26:52 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-17 01:03:40 -0600 |
commit | 1c8701f8b7b5fe287a0d9a1c433504f3f8f88ec3 (patch) | |
tree | 5d8539bf92482b818d079bf26c75446aaef0ec8b /sc/qa/unit | |
parent | 26c759b7dfcbceb295acbb1f895847bcc4dd6cce (diff) |
GPU Calc: unit test cases for AND
Turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-217 BUG
Change-Id: I768e3b58e37d56c527f364aab54b88ecfe8c0907
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/logical/and.xls | bin | 0 -> 8192 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/logical/and.xls b/sc/qa/unit/data/xls/opencl/logical/and.xls Binary files differnew file mode 100644 index 000000000000..19ae64bf39f7 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/logical/and.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 07828836557e..238cefd9878c 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -239,6 +239,7 @@ public: void testArrayFormulaSumXMY2(); void testStatisticalFormulaStDevP(); void testStatisticalFormulaCovar(); + void testLogicalFormulaAnd(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -409,6 +410,7 @@ public: CPPUNIT_TEST(testArrayFormulaSumXMY2); CPPUNIT_TEST(testStatisticalFormulaStDevP); CPPUNIT_TEST(testStatisticalFormulaCovar); + CPPUNIT_TEST(testLogicalFormulaAnd); CPPUNIT_TEST_SUITE_END(); private: @@ -4712,6 +4714,34 @@ void ScOpenclTest:: testArrayFormulaSumXMY2() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-217] +void ScOpenclTest:: testLogicalFormulaAnd() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/logical/and.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/logical/and.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 1; i <= 20; ++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 = 1; i <= 20; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(3, i, 0)); + double fExcel = pDocRes->GetValue(ScAddress(3, i, 0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} ScOpenclTest::ScOpenclTest() : ScBootstrapFixture( "/sc/qa/unit/data" ) { |