# HG changeset patch # User John W. Eaton # Date 1289423095 18000 # Node ID 84846912f3c193c6ad2898d7926438b4feb4d496 # Parent 16d744cce38c7e59c1a9830227d79cba04f4238d test/fntests.m: run tests for deprecated functions diff -r 16d744cce38c -r 84846912f3c1 scripts/ChangeLog --- a/scripts/ChangeLog Wed Nov 10 16:04:31 2010 -0500 +++ b/scripts/ChangeLog Wed Nov 10 16:04:55 2010 -0500 @@ -1,3 +1,7 @@ +2010-11-10 John W. Eaton + + * scripts/deprecated/dispatch.m: Don't set warning state in tests. + 2010-11-10 John W. Eaton * deprecated/dispatch.m: Deprecate dispatch function. diff -r 16d744cce38c -r 84846912f3c1 scripts/deprecated/dispatch.m --- a/scripts/deprecated/dispatch.m Wed Nov 10 16:04:31 2010 -0500 +++ b/scripts/deprecated/dispatch.m Wed Nov 10 16:04:55 2010 -0500 @@ -50,54 +50,52 @@ %!test # builtin function replacement -%! warning off Octave:deprecated-function %! dispatch('sin','length','string') %! assert(sin("abc"),3) %! assert(sin(0),0,10*eps); + %!test # 'any' function -%! warning off Octave:deprecated-function %! dispatch('sin','exp','any') %! assert(sin(0),1,eps); %! assert(sin("abc"),3); + %!test # 'builtin' function -%! warning off Octave:deprecated-function %! assert(builtin('sin',0),0,eps); %! builtin('eval','x=1;'); %! assert(x,1); + %!test # clear function mapping -%! warning off Octave:deprecated-function %! dispatch('sin','string') %! dispatch('sin','any') %! assert(sin(0),0,10*eps); + %!test # oct-file replacement -%! warning off Octave:deprecated-function %! dispatch('fft','length','string') %! assert(fft([1,1]),[2,0]); %! assert(fft("abc"),3) %! dispatch('fft','string'); + %!test # m-file replacement -%! warning off Octave:deprecated-function %! dispatch('hamming','length','string') %! assert(hamming(1),1) %! assert(hamming("abc"),3) %! dispatch('hamming','string') %!test # override preloaded builtin -%! warning off Octave:deprecated-function %! evalin('base','cos(1);'); %! dispatch('cos','length','string') %! evalin('base','assert(cos("abc"),3)'); %! evalin('base','assert(cos(0),1,eps)'); %! dispatch('cos','string') + %!test # override pre-loaded oct-file -%! warning off Octave:deprecated-function %! evalin('base','qr(1);'); %! dispatch('qr','length','string') %! evalin('base','assert(qr("abc"),3)'); %! evalin('base','assert(qr(1),1)'); %! dispatch('qr','string'); + %!test # override pre-loaded m-file -%! warning off Octave:deprecated-function %! evalin('base','hanning(1);'); %! dispatch('hanning','length','string') %! evalin('base','assert(hanning("abc"),3)'); diff -r 16d744cce38c -r 84846912f3c1 test/ChangeLog --- a/test/ChangeLog Wed Nov 10 16:04:31 2010 -0500 +++ b/test/ChangeLog Wed Nov 10 16:04:55 2010 -0500 @@ -1,3 +1,8 @@ +2010-11-10 John W. Eaton + + * fntests.m: Set warning state off for Octave:deprecated-functions. + (run_test_script): Do run tests for deprecated functions. + 2010-11-09 John W. Eaton * test_parser.m: New file. diff -r 16d744cce38c -r 84846912f3c1 test/fntests.m --- a/test/fntests.m Wed Nov 10 16:04:31 2010 -0500 +++ b/test/fntests.m Wed Nov 10 16:04:55 2010 -0500 @@ -136,7 +136,7 @@ for i = 1:length (lst) nm = lst(i).name; if (lst(i).isdir && ! strcmp (nm, ".") && ! strcmp (nm, "..") - && ! strcmp (nm, "CVS") && ! strcmp (nm, "deprecated") ) + && ! strcmp (nm, "CVS")) [p, n, xf, sk] = run_test_script (fid, [d, "/", nm]); dp += p; dn += n; @@ -215,6 +215,7 @@ warning ("on", "quiet"); try page_screen_output (0); + warning ("off", "Octave:deprecated-functions"); fid = fopen ("fntests.log", "wt"); if (fid < 0) error ("could not open fntests.log for writing");