diff options
author | shiming zhang <shiming@multicorewareinc.com> | 2013-11-12 15:06:55 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-15 11:54:28 -0600 |
commit | 9d98f56d956cb08e67c15a8d75ef1e5df4588ba5 (patch) | |
tree | 167fd280b2ee5c2b3c79985ca58fe0b337515c86 /sc/qa | |
parent | 906e1c9af7af41122034e36406622d9db7d68502 (diff) |
GPU Calc: unit test cases for ZTEST
Need to enable NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-188 BUG
Change-Id: I79cdfdd7f73cc3283bfa1cdabc00173422c953b4
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/statistical/ZTest.xls | bin | 0 -> 8192 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/statistical/ZTest.xls b/sc/qa/unit/data/xls/opencl/statistical/ZTest.xls Binary files differnew file mode 100644 index 000000000000..115fdbc16eb8 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/statistical/ZTest.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 94031561d3b8..d71f0ef5a1d0 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -224,6 +224,7 @@ public: void testStatisticalFormulaStDev(); void testStatisticalFormulaSlope(); void testStatisticalFormulaSTEYX(); + void testStatisticalFormulaZTest(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -379,6 +380,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaStDev); CPPUNIT_TEST(testStatisticalFormulaSlope); CPPUNIT_TEST(testStatisticalFormulaSTEYX); + CPPUNIT_TEST(testStatisticalFormulaZTest); CPPUNIT_TEST_SUITE_END(); private: @@ -4267,6 +4269,31 @@ void ScOpenclTest::testStatisticalFormulaSTEYX() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-188] +void ScOpenclTest::testStatisticalFormulaZTest() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/ZTest.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/ZTest.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 1; i <= 20; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(3,i,0)); + double fExcel = pDocRes->GetValue(ScAddress(3,i,0)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} //[AMLOEXT-192] void ScOpenclTest::testStatisticalFormulaBinomDist() { |