diff options
author | zhenyu yuan <zhenyuyuan@multicorewareinc.com> | 2013-11-09 19:41:09 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 20:30:38 -0600 |
commit | e8d9808591babdbda0f3c06504a9b6413b84f296 (patch) | |
tree | 236b4affc4e0db46b08df13ec21ad03910bdd589 /sc | |
parent | e7e69e9d9cbe31f79ad432310001e831ab3b1354 (diff) |
GPU Calc: unit test cases for MOD
Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-155 BUG
Change-Id: Iff3244e086b600d4636656daf9cc8b2a4b0bc578
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/mod.xls | bin | 0 -> 7168 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 25 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/mod.xls b/sc/qa/unit/data/xls/opencl/math/mod.xls Binary files differnew file mode 100644 index 000000000000..300102c63a28 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/mod.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 73e9de6f4395..9b68e14988eb 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -203,6 +203,7 @@ public: void testMathFormulaCombina(); void testMathFormulaEven(); void testMathFormulaLog(); + void testMathFormulaMod(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -337,6 +338,7 @@ public: CPPUNIT_TEST(testMathFormulaCombina); CPPUNIT_TEST(testMathFormulaEven); CPPUNIT_TEST(testMathFormulaLog); + CPPUNIT_TEST(testMathFormulaMod); CPPUNIT_TEST_SUITE_END(); private: @@ -3380,6 +3382,29 @@ void ScOpenclTest::testMathFormulaLN() xDocSh->DoClose(); xDocShRes->DoClose(); } +//AMLOEXT-155 +void ScOpenclTest::testMathFormulaMod() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/mod.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/mod.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++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(); +} //[ AMLOEXT-156] void ScOpenclTest::testMathFormulaRound() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index c10c5833cb97..e9adcef5754d 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1435,6 +1435,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocKombin2: case ocEven: case ocLog: + case ocMod: // Don't change the state. break; default: |