Mercurial > hg > octave-nkf
changeset 13185:e0a3cca6e677
Add tolerances to binopdf and tpdf tests.
* statistics/distributions/binopdf.m: Add tolerance to accommodate MacOS's
gammal.
* statistics/distributions/tpdf.m: Add tolerance.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Wed, 21 Sep 2011 20:23:59 -0400 |
parents | 8a124aeb7ded |
children | 2896c083576a |
files | scripts/statistics/distributions/binopdf.m |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/statistics/distributions/binopdf.m +++ b/scripts/statistics/distributions/binopdf.m @@ -66,15 +66,20 @@ endfunction -%!shared x,y +%!shared x,y,tol +%! if (ismac ()) +%! tol = eps (); +%! else +%! tol = 0; +%! endif %! x = [-1 0 1 2 3]; %! y = [0 1/4 1/2 1/4 0]; -%!assert(binopdf (x, 2*ones(1,5), 0.5*ones(1,5)), y); -%!assert(binopdf (x, 2, 0.5*ones(1,5)), y); -%!assert(binopdf (x, 2*ones(1,5), 0.5), y); +%!assert(binopdf (x, 2*ones(1,5), 0.5*ones(1,5)), y, tol); +%!assert(binopdf (x, 2, 0.5*ones(1,5)), y, tol); +%!assert(binopdf (x, 2*ones(1,5), 0.5), y, tol); %!assert(binopdf (x, 2*[0 -1 NaN 1.1 1], 0.5), [0 NaN NaN NaN 0]); %!assert(binopdf (x, 2, 0.5*[0 -1 NaN 3 1]), [0 NaN NaN NaN 0]); -%!assert(binopdf ([x, NaN], 2, 0.5), [y, NaN]); +%!assert(binopdf ([x, NaN], 2, 0.5), [y, NaN], tol); %% Test class of input preserved %!assert(binopdf (single([x, NaN]), 2, 0.5), single([y, NaN]));