summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-10-25 11:05:42 +0800
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-29 17:00:25 -0400
commit7c95710bb04d1f5fcbf291bc9261aa44748c7575 (patch)
tree83871768df6ef6132a5153c68bdd62cd00291cf0 /sc
parentf15ab5095a37bb2bd7f6e1ac4d5bdfb46ab29c6f (diff)
Testcases for RSQ in GPU Calc
Change-Id: I5e70883fa61da2afbe7254ecb448fcfd0abb41a3 Signed-off-by: Wei Wei <weiwei@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xls/OpenclCase/statistical/Rsq.xlsbin0 -> 7168 bytes
-rw-r--r--sc/qa/unit/opencl-test.cxx24
2 files changed, 23 insertions, 1 deletions
diff --git a/sc/qa/unit/data/xls/OpenclCase/statistical/Rsq.xls b/sc/qa/unit/data/xls/OpenclCase/statistical/Rsq.xls
new file mode 100644
index 000000000000..26794f8c30c3
--- /dev/null
+++ b/sc/qa/unit/data/xls/OpenclCase/statistical/Rsq.xls
Binary files differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 29dd58bd9b18..c6c9997e7208 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -84,6 +84,7 @@ public:
void testFinacialDISCFormula();
void testFinacialINTRATEFormula();
void testMathFormulaCos();
+ void testStatisticalFormulaRsq();
void testStatisticalFormulaPearson();
void testStatisticalFormulaNegbinomdist();
CPPUNIT_TEST_SUITE(ScOpenclTest);
@@ -118,6 +119,7 @@ public:
CPPUNIT_TEST(testFinacialINTRATEFormula);
CPPUNIT_TEST(testMathFormulaCos);
CPPUNIT_TEST(testStatisticalFormulaNegbinomdist);
+ CPPUNIT_TEST(testStatisticalFormulaRsq);
CPPUNIT_TEST(testStatisticalFormulaPearson);
CPPUNIT_TEST_SUITE_END();
@@ -1048,12 +1050,32 @@ void ScOpenclTest::testStatisticalFormulaPearson()
{
double fLibre = pDoc->GetValue(ScAddress(2,i,0));
double fExcel = pDocRes->GetValue(ScAddress(2,i,0));
- std::cout<<fLibre<<"\t"<<fExcel<<"\n";
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
+//[AMLOEXT-83]
+void ScOpenclTest::testStatisticalFormulaRsq()
+{
+ ScDocShellRef xDocSh = loadDoc("OpenclCase/statistical/Rsq.", XLS);
+ enableOpenCL(xDocSh);
+ ScDocument* pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc); xDocSh->DoHardRecalc(true);
+ ScDocShellRef xDocShRes = loadDoc("OpenclCase/statistical/Rsq.", XLS);
+ ScDocument* pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ // Check the results of formula cells in the shared formula range.
+ for (SCROW i = 1; 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" )
{