diff options
author | dechuang <dechuang@multicorewareinc.com> | 2013-11-12 16:21:10 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-15 11:54:30 -0600 |
commit | 8bf3864069cf67ae97299c4e0e042b922a45a989 (patch) | |
tree | 488a7fa119c9e4be11ac7843a80fb6aad15a2aaa /sc/qa | |
parent | ba6584719fb8b1b1fe60ca96fd59db318ae01c80 (diff) |
GPU Calc: unit test cases for CONVERT
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-175 BUG
Change-Id: If490d33b86b249f4f88cfec1d82131b9967942d1
Signed-off-by: haochen <haochen@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/math/convert.xls | bin | 0 -> 24576 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/convert.xls b/sc/qa/unit/data/xls/opencl/math/convert.xls Binary files differnew file mode 100644 index 000000000000..4e2f2061d535 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/convert.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 0fda4f88617a..c4d028e7bfe3 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -227,6 +227,7 @@ public: void testStatisticalFormulaZTest(); void testMathFormulaPi(); void testMathFormulaRandom(); + void testMathFormulaConvert(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -385,6 +386,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaZTest); CPPUNIT_TEST(testMathFormulaPi); CPPUNIT_TEST(testMathFormulaRandom); + CPPUNIT_TEST(testMathFormulaConvert); CPPUNIT_TEST_SUITE_END(); private: @@ -4058,7 +4060,28 @@ void ScOpenclTest::testStatisticalFormulaChiInv() xDocSh->DoClose(); xDocShRes->DoClose(); } - +//[AMLOEXT-175] +void ScOpenclTest::testMathFormulaConvert() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/convert.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/convert.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 3; ++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(); +} //[ AMLOEXT-176 ] void ScOpenclTest::testMathCountIfsFormula() { |