summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorminwang <min@multicorewareinc.com>2013-12-05 09:06:17 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-18 20:34:57 -0600
commitde0013f64ad18f93dc175bdf3843aec1cfa102cb (patch)
tree69b6ca8f4aeddae070d9169b512ef1933accf63f /sc/qa
parent4ea6b93c0ffec54f5aa8e742acba06a09276dae1 (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>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/data/xls/opencl/logical/xor.xlsbin0 -> 3285504 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/logical/xor.xls b/sc/qa/unit/data/xls/opencl/logical/xor.xls
new file mode 100644
index 000000000000..fccba9b19f1d
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/logical/xor.xls
Binary files differ
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" )
{