Mercurial > octave
diff scripts/statistics/base/skewness.m @ 20515:76f67400649e
Use '-local' option to warning to simplify BIST tests.
* dos.m, unix.m, savepath.m, kurtosis.m, skewness.m:
Use '-local' option to warning instead of unwind/protect block.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 25 Sep 2015 21:00:29 -0700 |
parents | d9341b422488 |
children | 516bb87ea72e |
line wrap: on
line diff
--- a/scripts/statistics/base/skewness.m Fri Sep 25 18:50:41 2015 -0700 +++ b/scripts/statistics/base/skewness.m Fri Sep 25 21:00:29 2015 -0700 @@ -152,15 +152,10 @@ ## Verify no "divide-by-zero" warnings %!test -%! wstate = warning ("query", "Octave:divide-by-zero"); -%! warning ("on", "Octave:divide-by-zero"); -%! unwind_protect -%! lastwarn (""); # clear last warning -%! skewness (1); -%! assert (lastwarn (), ""); -%! unwind_protect_cleanup -%! warning (wstate, "Octave:divide-by-zero"); -%! end_unwind_protect +%! warning ("on", "Octave:divide-by-zero", "local"); +%! lastwarn (""); # clear last warning +%! skewness (1); +%! assert (lastwarn (), ""); ## Test input validation %!error skewness () @@ -172,3 +167,4 @@ %!error <DIM must be an integer> skewness (1, [], 1.5) %!error <DIM must be .* a valid dimension> skewness (1, [], 0) %!error <DIM must be .* a valid dimension> skewness (1, [], 3) +