diff options
author | minwang <min@multicorewareinc.com> | 2013-12-05 09:06:17 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:36:20 -0600 |
commit | 48d627edcf039a6be52cbe7220472da35dae32a5 (patch) | |
tree | 0ea75107f2abb42ced75b5355efed61ffc62e356 /sc/qa/unit/opencl-test.cxx | |
parent | cd141fb4be54913c456eb617b7ec586d1b85c2e6 (diff) |
GPU Calc: unit test cases for XOR
Need turn NO_FALLBACK_TO_SWINTERP on in formulagroupcl.cxx for test
AMLOEXT-272 BUG
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/qa/unit/opencl-test.cxx')
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 45878446f8b1..7796b57a675a 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -247,6 +247,7 @@ public: void testStatisticalParallelCountBug(); void testSpreadSheetFormulaVLookup(); void testLogicalFormulaNot(); + void testLogicalFormulaXor(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -425,6 +426,7 @@ public: CPPUNIT_TEST(testSpreadSheetFormulaVLookup); CPPUNIT_TEST(testLogicalFormulaOr); CPPUNIT_TEST(testLogicalFormulaNot); + CPPUNIT_TEST(testLogicalFormulaXor); CPPUNIT_TEST_SUITE_END(); private: @@ -4950,6 +4952,28 @@ void ScOpenclTest:: testLogicalFormulaNot() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-272] +void ScOpenclTest:: testLogicalFormulaXor() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/logical/xor.", XLS); + ScDocument *pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/logical/xor.", XLS); + ScDocument *pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i < 30000; ++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" ) { |