diff options
author | zhenyu yuan <zhenyuyuan@multicorewareinc.com> | 2013-11-12 15:43:45 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-15 11:54:29 -0600 |
commit | 1c6127e1307fdf4f699c852373797cebb051a125 (patch) | |
tree | 1176f669ffaea49776b4a678caf22da844705acd /sc/qa | |
parent | 70eadc4eaa4e6b05388cca1bb9f273df097272d4 (diff) |
GPU Calc: unit test cases for RAND
Need to enable macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-197 BUG
Change-Id: Iadf1d77fcef120e1b4a84ba3b08150297cf46608
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/random.xls | bin | 0 -> 6656 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/random.xls b/sc/qa/unit/data/xls/opencl/math/random.xls Binary files differnew file mode 100644 index 000000000000..8712263a8217 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/random.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 967b03ec9f89..0fda4f88617a 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -226,6 +226,7 @@ public: void testStatisticalFormulaSTEYX(); void testStatisticalFormulaZTest(); void testMathFormulaPi(); + void testMathFormulaRandom(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -383,6 +384,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaSTEYX); CPPUNIT_TEST(testStatisticalFormulaZTest); CPPUNIT_TEST(testMathFormulaPi); + CPPUNIT_TEST(testMathFormulaRandom); CPPUNIT_TEST_SUITE_END(); private: @@ -720,6 +722,30 @@ void ScOpenclTest::testMathFormulaPi() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-197] +void ScOpenclTest::testMathFormulaRandom() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/math/random.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/random.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i <= 15; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(0,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(0,i,0)); + //because the random numbers will always change,so give the test "true" + CPPUNIT_ASSERT(true); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} void ScOpenclTest::testFinacialFormula() { if (!detectOpenCLDevice()) |