From f7cd30228fea8426d2652df5f673808a1032ebe0 Mon Sep 17 00:00:00 2001 From: shiming zhang Date: Mon, 4 Nov 2013 16:58:38 +0800 Subject: [PATCH] GPU Calc: unit test cases for STANDARDIZE Need open macro NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test AMLOEXT-77 BUG Change-Id: Ie2919ca8d99e19ff2d17fe9d7fc3fbe2a49a4e05 Signed-off-by: haochen Signed-off-by: I-Jui (Ray) Sung --- .../data/xls/opencl/statistical/Standard.xls | Bin 0 -> 7168 bytes sc/qa/unit/opencl-test.cxx | 27 ++++++++++++++++++ sc/source/core/tool/token.cxx | 1 + 3 files changed, 28 insertions(+) create mode 100644 sc/qa/unit/data/xls/opencl/statistical/Standard.xls diff --git a/sc/qa/unit/data/xls/opencl/statistical/Standard.xls b/sc/qa/unit/data/xls/opencl/statistical/Standard.xls new file mode 100644 index 0000000000000000000000000000000000000000..fe735e52b2482fbe68b7b193de227849b0693e21 GIT binary patch literal 7168 zcmeHLeQcH08GqjU(Z07W?QMHshqmBd8KppR?dn$iV7*sCbjpVe{Hfa!p0zzjeQU?yM| zU^bu@Fb8lI;ERAdKt13~fCj+TfG-1RUt_vu|625~OTW)cx1V_I|GO8kv5I+qd3DlT zO!=Dok0K&o^6k;M_%m=TrJwP!cCfc2{O>9^s19uwV>5vuorj(!PXb#kFDmvmt>|fDy@rATe3rG{-~IG#OEQ*w`GHFf(OKBZENj&p!3XA-GVtD#+toh^N$#tyx|GW4t@ab57o^AY)q~$Cb|IZu;Upo$d z);RdUn0P-TLG|GUOiLpCs0Z0OE-ALbxL4cKc%HUpai6y3@qBGVaewMtx?k2KT6Qw6 zBX_qfi!PoYZJyt{IJ)>p$n|&N*<;xNk!25A^1du*R!=so#JnW4H;)8H2_r5W8l*7E ztiKz($Ch;#Zi#lnilC0j)DP)NoD(+A3mfNveF{g#X{pllh01`_8gT6$#$|J`r@OZe z7tVps!Qt3Y3U^IghA@d|O^59O&`B4bEi4{hNKN7j<|M8nDE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8k8=c7`gQx zyhi|;5<#c`hrg_8d}E)b{k0Fbzi@D$hD2sgrX5dz%JaPYyLX?wsv`L4W6;0$qiyqn z^Sf{>ftw5q+h|LThbFP z$c;(oM99XRQvmr!vZ=?ML^qG4R_FoU#LuvV+MsuP5&;I}VpO*g*WvqX( literal 0 HcmV?d00001 diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 87414c04b451..d108f83f0d8b 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -128,6 +128,7 @@ public: void testMathFormulaSin(); void testMathFormulaTan(); void testMathFormulaTanH(); + void testStatisticalFormulaStandard(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -187,6 +188,7 @@ public: CPPUNIT_TEST(testMathFormulaSin); CPPUNIT_TEST(testMathFormulaTan); CPPUNIT_TEST(testMathFormulaTanH); + CPPUNIT_TEST(testStatisticalFormulaStandard); CPPUNIT_TEST_SUITE_END(); private: @@ -1359,6 +1361,31 @@ void ScOpenclTest::testFinacialINTRATEFormula() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-77] +void ScOpenclTest::testStatisticalFormulaStandard() +{ + if (!detectOpenCLDevice()) + return; + + ScDocShellRef xDocSh = loadDoc("opencl/statistical/Standard.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + + ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Standard.", 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-82] void ScOpenclTest::testStatisticalFormulaPearson() { diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index ee9e1ce3a052..2de1508e21bc 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1374,6 +1374,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) case ocSin: case ocTan: case ocTanHyp: + case ocStandard: // Don't change the state. break; default: