Mercurial > hg > octave-lojdl
changeset 12491:981cd6796065
Use modern warning function rather than deprecated built-in variable to set warning state.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 01 Mar 2011 11:28:31 -0800 |
parents | 30f2a3b1d236 |
children | 5b1654bc5012 |
files | scripts/ChangeLog scripts/general/isscalar.m scripts/general/isvector.m test/ChangeLog test/test_index-wfi-t.m |
diffstat | 5 files changed, 16 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-03-01 Rik <octave@nomad.inbox5.com> + + * general/isscalar.m, general/isvector.m: Use modern warning function + rather than deprecated built-in variable to set warning state. + 2010-02-28 Rik <octave@nomad.inbox5.com> * general/iscolumn.m, general/isrow.m: Add 2 new utility functions
--- a/scripts/general/isscalar.m +++ b/scripts/general/isscalar.m @@ -35,26 +35,22 @@ endfunction %!assert(isscalar (1)); - %!assert(!(isscalar ([1, 2]))); - %!assert(!(isscalar ([]))); - %!assert(!(isscalar ([1, 2; 3, 4]))); %!test -%! warn_str_to_num = 0; +%! warning ("off", "Octave:str-to-num"); %! assert((isscalar ("t"))); %!assert(!(isscalar ("test"))); - %!assert(!(isscalar (["test"; "ing"]))); %!test %! s.a = 1; %! assert((isscalar (s))); +%% Test input validation %!error isscalar (); - %!error isscalar (1, 2);
--- a/scripts/general/isvector.m +++ b/scripts/general/isvector.m @@ -40,19 +40,16 @@ endfunction %!assert(isvector (1)); - %!assert(isvector ([1; 2; 3])); - %!assert(!(isvector ([]))); - %!assert(!(isvector ([1, 2; 3, 4]))); %!test -%! warn_str_to_num = 0; +%! warning ("off", "Octave:str-to-num"); %! assert((isvector ("t"))); %!test -%! warn_str_to_num = 0; +%! warning ("off", "Octave:str-to-num"); %! assert((isvector ("test"))); %!assert(!(isvector (["test"; "ing"]))); @@ -61,7 +58,7 @@ %! s.a = 1; %! assert((isvector (s))); +%% Test input validation %!error isvector (); - %!error isvector ([1, 2], 2);
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2010-03-01 Rik <octave@nomad.inbox5.com> + + * test/test_index-wfi-t.m: Use modern warning function + rather than deprecated built-in variable to set warning state. + 2010-02-22 Rik <octave@nomad.inbox5.com> * fntests.m: Use single quotes around regexp patterns.
--- a/test/test_index-wfi-t.m +++ b/test/test_index-wfi-t.m @@ -19,7 +19,7 @@ %% test/octave.test/index-wfi-t/s-1.m %!test %! wfi = warning ("query", "Octave:fortran-indexing"); -%! warn_fortran_indexing = 1; +%! warning ("on", "Octave:fortran-indexing"); %! a = []; %! assert(isempty (a)); %! warning (wfi.state, "Octave:fortran-indexing");