summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authoryiming ju <yiming@multicorewareinc.com>2013-12-31 11:16:23 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:36:57 -0600
commit35764e147a11721a574069b31dcacdf095139841 (patch)
treeef7b978478b876a449ad821f1091f1fc8e7aba8d /sc
parentc19298d12baf22d7d1e44da5717371e9ca3ffc7b (diff)
GPU Calc: unit test cases for Averageif not support double vector
AMLOEXT-386 BUG Change-Id: Ie7c20cf9e354ca4c88388238ba735262098bb09f 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')
-rw-r--r--sc/qa/unit/data/xls/opencl/math/averageif_mix.xlsbin0 -> 24064 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx25
2 files changed, 24 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/averageif_mix.xls b/sc/qa/unit/data/xls/opencl/math/averageif_mix.xls
new file mode 100644
index 000000000000..0fd3f8dd5dba
--- /dev/null
+++ b/sc/qa/unit/data/xls/opencl/math/averageif_mix.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 4103dad757f1..cf3e01412087 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -286,6 +286,7 @@ public:
void testAddInFormulaBesseLJ();
void testNegSub();
void testStatisticalFormulaAvedev();
+ void testMathFormulaAverageIf_Mix();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -503,6 +504,7 @@ public:
CPPUNIT_TEST(testAddInFormulaBesseLJ);
CPPUNIT_TEST(testNegSub);
CPPUNIT_TEST(testStatisticalFormulaAvedev);
+ CPPUNIT_TEST(testMathFormulaAverageIf_Mix);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5945,7 +5947,28 @@ void ScOpenclTest::testNegSub()
xDocSh->DoClose();
xDocShRes->DoClose();
}
-
+//[AMLOEXT-386]
+void ScOpenclTest::testMathFormulaAverageIf_Mix()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh = loadDoc("opencl/math/averageif_mix.", XLS);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes = loadDoc("opencl/math/averageif_mix.", 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));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{