summaryrefslogtreecommitdiff
path: root/sc/qa/unit/opencl-test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit/opencl-test.cxx')
-rw-r--r--sc/qa/unit/opencl-test.cxx26
1 files changed, 26 insertions, 0 deletions
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())