diff options
author | yiming ju <yiming@multicorewareinc.com> | 2013-12-31 11:16:23 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-12-31 17:20:01 -0600 |
commit | dc6639a4f2556bec5d0031cbefca230e6e31eef5 (patch) | |
tree | d16d950d9ac9b695a6776d4906ed4ef85623bffd | |
parent | 8c5f5aab2e3f1c600ff362632fb4db8d8c065d46 (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>
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/averageif_mix.xls | bin | 0 -> 24064 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 |
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 Binary files differnew file mode 100644 index 000000000000..0fd3f8dd5dba --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/averageif_mix.xls 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" ) { |