changeset 25764:7c0dabd59d18

Stop deprecated functions from issuing warning during BIST tests. * chop.m, toascii.m: Add code to run function once before running BIST tests so that one-time warning is issued and thereafter suppressed.
author Rik <rik@octave.org>
date Thu, 09 Aug 2018 13:46:27 -0700
parents 2ccad4396afc
children 97ea2329d5d8
files scripts/deprecated/chop.m scripts/deprecated/toascii.m
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/deprecated/chop.m	Thu Aug 09 13:26:23 2018 -0700
+++ b/scripts/deprecated/chop.m	Thu Aug 09 13:46:27 2018 -0700
@@ -82,6 +82,11 @@
 endfunction
 
 
+## First test is necessary to provoke 1-time legacy warning
+%!test
+%! warning ("off", "Octave:deprecated-function", "local");
+%! chop (0, 1);
+
 %!assert (chop (e, 3), 2.72)
 %!assert (chop (e, 4), 2.718)
 %!assert (chop (e, 4, 5), 2.72)
--- a/scripts/deprecated/toascii.m	Thu Aug 09 13:26:23 2018 -0700
+++ b/scripts/deprecated/toascii.m	Thu Aug 09 13:46:27 2018 -0700
@@ -60,6 +60,11 @@
 endfunction
 
 
+## First test is necessary to provoke 1-time legacy warning
+%!test
+%! warning ("off", "Octave:deprecated-function", "local");
+%! toascii ("");
+
 %!assert (toascii (char (0:127)), 0:127)
 %!assert (toascii (" ":"@"), 32:64)
 %!assert (toascii ("A":"Z"), 65:90)