changeset 31254:5d6b058a22dc

maint: use sequence "%!#" to disable BIST tests. * interp1.m, logspace.m, triplequad.m, textread.m, __w2mpth__.m, ode15i.m, __print_parse_opts__.m, ichol.m, discrete_rnd.m, isstring.m: Use sequence "%!#" to disable BIST tests.
author Rik <rik@octave.org>
date Tue, 04 Oct 2022 07:34:47 -0700
parents a40c0b7aa376
children 43068d904d9d
files scripts/general/interp1.m scripts/general/logspace.m scripts/general/triplequad.m scripts/legacy/textread.m scripts/miscellaneous/private/__w2mpth__.m scripts/ode/ode15i.m scripts/plot/util/private/__print_parse_opts__.m scripts/sparse/ichol.m scripts/statistics/discrete_rnd.m scripts/strings/isstring.m
diffstat 10 files changed, 106 insertions(+), 106 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/interp1.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/general/interp1.m	Tue Oct 04 07:34:47 2022 -0700
@@ -559,8 +559,8 @@
 %!   interp1 (xp,yp,xi,style) + 1i * interp1 (xp,yp.^2,xi,style))
 ## This test is expected to fail, so commented out.
 ## "previous" and "next" options are not symmetric w.r.t to flipping xp,yp
-#%!assert (interp1 (xp,yp,xi,style),...
-#%!        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
+%!#assert (interp1 (xp,yp,xi,style),...
+%!#        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
 %!assert (ppval (interp1 (xp,yp,style,"pp"),xi),
 %!        interp1 (xp,yp,xi,style,"extrap"),10*eps)
 %!error interp1 (1,1,1, style)
@@ -579,8 +579,8 @@
 %!assert <*61903> ...
 %!  (interp1 (xp, yp + 1i * yp.^2, xi, style),...
 %!   interp1 (xp,yp,xi,style) + 1i * interp1 (xp,yp.^2,xi,style))
-#%!assert (interp1 (xp,yp,xi,style),...
-#%!        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
+%!#assert (interp1 (xp,yp,xi,style),...
+%!#        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
 %!assert (ppval (interp1 (xp,yp,style,"pp"),xi),
 %!        interp1 (xp,yp,xi,style,"extrap"),10*eps)
 %!assert (interp1 (yp, xi, style, 0), ...
@@ -602,8 +602,8 @@
 %!assert <*61903> ...
 %!  (interp1 (xp, yp + 1i * yp.^2, xi, style),...
 %!   interp1 (xp,yp,xi,style) + 1i * interp1 (xp,yp.^2,xi,style))
-#%!assert (interp1 (xp,yp,xi,style),...
-#%!        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
+%!#assert (interp1 (xp,yp,xi,style),...
+%!#        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
 %!assert (ppval (interp1 (xp,yp,style,"pp"),xi),
 %!        interp1 (xp,yp,xi,style,"extrap"),10*eps)
 %!error interp1 (1,1,1, style)
@@ -622,8 +622,8 @@
 %!assert <*61903> ...
 %!  (interp1 (xp, yp + 1i * yp.^2, xi, style),...
 %!   interp1 (xp,yp,xi,style) + 1i * interp1 (xp,yp.^2,xi,style))
-#%!assert (interp1 (xp,yp,xi,style),...
-#%!        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
+%!#assert (interp1 (xp,yp,xi,style),...
+%!#        interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps)
 %!assert (ppval (interp1 (xp,yp,style,"pp"),xi),
 %!        interp1 (xp,yp,xi,style,"extrap"),10*eps)
 %!assert (interp1 (yp, xi, style, 0), ...
--- a/scripts/general/logspace.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/general/logspace.m	Tue Oct 04 07:34:47 2022 -0700
@@ -133,8 +133,8 @@
 ## FIXME: These are bizarre corner cases for Matlab compatibility.  See
 ## bug #56933.  This is marked as "Won't Fix", but if linspace is updated at
 ## some point then these tests can be re-instated.
-##%!assert (logspace (-Inf, 0, 3), [0, NaN, 1])
-##%!assert (logspace (Inf, 0, 3), [Inf, NaN, 1])
+%!#assert (logspace (-Inf, 0, 3), [0, NaN, 1])
+%!#assert (logspace (Inf, 0, 3), [Inf, NaN, 1])
 
 ## Test input validation
 %!error <Invalid call> logspace ()
--- a/scripts/general/triplequad.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/general/triplequad.m	Tue Oct 04 07:34:47 2022 -0700
@@ -90,6 +90,6 @@
 %!assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadcc), pi^(3/2) * erf (1).^3, 1e-6)
 
 ## These tests are too expensive to run normally (~30 sec each).  Disable them
-#%!assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadgk), pi^(3/2) * erf (1).^3, 1e-6)
-#%!assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadl), pi^(3/2) * erf (1).^3, 1e-6)
-#%!assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadv), pi^(3/2) * erf (1).^3, 1e-6)
+%!#assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadgk), pi^(3/2) * erf (1).^3, 1e-6)
+%!#assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadl), pi^(3/2) * erf (1).^3, 1e-6)
+%!#assert (triplequad (@(x,y,z) exp (-x.^2 - y.^2 - z.^2) , -1, 1, -1, 1, -1, 1, [], @quadv), pi^(3/2) * erf (1).^3, 1e-6)
--- a/scripts/legacy/textread.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/legacy/textread.m	Tue Oct 04 07:34:47 2022 -0700
@@ -455,82 +455,82 @@
 %! unlink (f);
 
 ### Tests with format repeat count #5, nr of data lines = limiting factor
-#%!test
-#%! f = tempname ();
-#%! fid = fopen (f, "w");
-#%! fprintf (fid, "%2d\n%s\n%2dn%s", ...
-#%!                1, "a", 2, "b");
-#%! fclose (fid);
-#%! [a, b] = textread (f, "%d %s", 2);
-#%! assert (a, int32 (1));
-#%! assert (b, {"a"});
+%!#test
+%!# f = tempname ();
+%!# fid = fopen (f, "w");
+%!# fprintf (fid, "%2d\n%s\n%2dn%s", ...
+%!#                1, "a", 2, "b");
+%!# fclose (fid);
+%!# [a, b] = textread (f, "%d %s", 2);
+%!# assert (a, int32 (1));
+%!# assert (b, {"a"});
 
 ### Read multiple lines using empty format string, missing data (should be 0)
-#%!test
-#%! f = tempname ();
-#%! unlink (f);
-#%! fid = fopen (f, "w");
-#%! d = rand (1, 4);
-#%! fprintf (fid, "%f, %f, ,  %f,  %f ", d);
-#%! fclose (fid);
-#%! A = textread (f, "");
-#%! unlink (f);
-#%! assert (A, [ d(1:2) 0 d(3:4)], 1e-6);
+%!#test
+%!# f = tempname ();
+%!# unlink (f);
+%!# fid = fopen (f, "w");
+%!# d = rand (1, 4);
+%!# fprintf (fid, "%f, %f, ,  %f,  %f ", d);
+%!# fclose (fid);
+%!# A = textread (f, "");
+%!# unlink (f);
+%!# assert (A, [ d(1:2) 0 d(3:4)], 1e-6);
 
 ### Test with empty positions - ML returns 0 for empty fields
-#%!test
-#%! f = tempname ();
-#%! unlink (f);
-#%! fid = fopen (f, "w");
-#%! d = rand (1, 4);
-#%! fprintf (fid, ",2,,4\n5,,7,\n");
-#%! fclose (fid);
-#%! A = textread (f, "", "delimiter", ",");
-#%! unlink (f);
-#%! assert (A, [0 2 0 4; 5 0 7 0], 1e-6);
+%!#test
+%!# f = tempname ();
+%!# unlink (f);
+%!# fid = fopen (f, "w");
+%!# d = rand (1, 4);
+%!# fprintf (fid, ",2,,4\n5,,7,\n");
+%!# fclose (fid);
+%!# A = textread (f, "", "delimiter", ",");
+%!# unlink (f);
+%!# assert (A, [0 2 0 4; 5 0 7 0], 1e-6);
 
 ### Another test with empty format + positions, now with more incomplete lower
 ### row (must be appended with zeros to get rectangular matrix)
-#%!test
-#%! f = tempname ();
-#%! unlink (f);
-#%! fid = fopen (f, "w");
-#%! d = rand (1, 4);
-#%! fprintf (fid, ",2,,4\n5,\n");
-#%! fclose (fid);
-#%! A = textread (f, "", "delimiter", ",");
-#%! unlink (f);
-#%! assert (A, [0 2 0 4; 5 0 0 0], 1e-6);
+%!#test
+%!# f = tempname ();
+%!# unlink (f);
+%!# fid = fopen (f, "w");
+%!# d = rand (1, 4);
+%!# fprintf (fid, ",2,,4\n5,\n");
+%!# fclose (fid);
+%!# A = textread (f, "", "delimiter", ",");
+%!# unlink (f);
+%!# assert (A, [0 2 0 4; 5 0 0 0], 1e-6);
 
 ### Test endofline
-#%!test <*45046>
-#%! f = tempname ();
-#%! fid = fopen (f, "w");
-#%! fprintf (fid, "a\rb\rc");
-#%! fclose (fid);
-#%! ## Test EOL detection
-#%! d = textread (f, "%s");
-#%! assert (d, {"a";"b";"c"});
-#%! ## Test explicit EOL specification (bug #45046)
-#%! d = textread (f, "%s", "endofline", "\r");
-#%! assert (d, {"a"; "b"; "c"});
-#%! unlink (f);
+%!#test <*45046>
+%!# f = tempname ();
+%!# fid = fopen (f, "w");
+%!# fprintf (fid, "a\rb\rc");
+%!# fclose (fid);
+%!# ## Test EOL detection
+%!# d = textread (f, "%s");
+%!# assert (d, {"a";"b";"c"});
+%!# ## Test explicit EOL specification (bug #45046)
+%!# d = textread (f, "%s", "endofline", "\r");
+%!# assert (d, {"a"; "b"; "c"});
+%!# unlink (f);
 
 ### Properly process single-quoted EOL args
-#%!test <*46477>
-#%! f = tempname ();
-#%! fid = fopen (f, "w");
-#%! fprintf (fid, "hello, world!");
-#%! fclose (fid);
-#%! [a, b] = textread (f, "%s%s", "endofline", '\n');
-#%! assert (a{1}, "hello,");
-#%! assert (b{1}, "world!");
+%!#test <*46477>
+%!# f = tempname ();
+%!# fid = fopen (f, "w");
+%!# fprintf (fid, "hello, world!");
+%!# fclose (fid);
+%!# [a, b] = textread (f, "%s%s", "endofline", '\n');
+%!# assert (a{1}, "hello,");
+%!# assert (b{1}, "world!");
 
 ### Test input validation
-#%!error textread ()
-#%!error textread (1)
-#%!error <arguments must be strings> textread (1, "%f")
-#%!error <arguments must be strings> textread ("fname", 1)
-#%!error <missing or invalid value for> textread (file_in_loadpath ("textread.m"), "", "headerlines")
-#%!error <missing or invalid value for> textread (file_in_loadpath ("textread.m"), "", "headerlines", 'hh')
-#%!error <character value required for> textread (file_in_loadpath ("textread.m"), "%s", "endofline", true)
+%!#error textread ()
+%!#error textread (1)
+%!#error <arguments must be strings> textread (1, "%f")
+%!#error <arguments must be strings> textread ("fname", 1)
+%!#error <missing or invalid value for> textread (file_in_loadpath ("textread.m"), "", "headerlines")
+%!#error <missing or invalid value for> textread (file_in_loadpath ("textread.m"), "", "headerlines", 'hh')
+%!#error <character value required for> textread (file_in_loadpath ("textread.m"), "%s", "endofline", true)
--- a/scripts/miscellaneous/private/__w2mpth__.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/miscellaneous/private/__w2mpth__.m	Tue Oct 04 07:34:47 2022 -0700
@@ -64,12 +64,12 @@
 
 ## Use single quote strings for winpaths to cope with backslashes.
 ## These tests are commented out until a better place is found (bug #44581)
-##%!test
-##%! if (ispc)
-##%!   assert (__w2mpth__ ('file.fil'), 'file.fil');
-##%!   assert (__w2mpth__ ('\file.fil'), '/file.fil');
-##%!   assert (__w2mpth__ ('G:\file.fil'), '/G/file.fil');
-##%!   assert (__w2mpth__ ('r:\subdir\file.fil'), '/r/subdir/file.fil');
-##%!   assert (__w2mpth__ ('relative\path\to\file.dat'),
-##%!                       'relative/path/to/file.dat')
-##%! endif
+%!#test
+%!# if (ispc)
+%!#   assert (__w2mpth__ ('file.fil'), 'file.fil');
+%!#   assert (__w2mpth__ ('\file.fil'), '/file.fil');
+%!#   assert (__w2mpth__ ('G:\file.fil'), '/G/file.fil');
+%!#   assert (__w2mpth__ ('r:\subdir\file.fil'), '/r/subdir/file.fil');
+%!#   assert (__w2mpth__ ('relative\path\to\file.dat'),
+%!#                       'relative/path/to/file.dat')
+%!# endif
--- a/scripts/ode/ode15i.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/ode/ode15i.m	Tue Oct 04 07:34:47 2022 -0700
@@ -469,7 +469,7 @@
 %! assert ([t2(end), y2(end,:)], [0, 1, 0, 0], 2e-2);
 
 ## Solve in backward direction with MaxStep option
-#%!testif HAVE_SUNDIALS
+%!#testif HAVE_SUNDIALS
 %! YPref = [-0.001135972751027; -0.000000027483627; 0.001136000234654];
 %! Yref = [0.617234887614937, 0.000006153591397, 0.382758958793666];
 %! opt = odeset ("MaxStep", 1e-2);
@@ -479,7 +479,7 @@
 %! assert (t2(9)-t2(10), 1e-2, 1e-2);
 
 ## Solve in backward direction starting with intermediate step
-#%!testif HAVE_SUNDIALS
+%!#testif HAVE_SUNDIALS
 %! YPref = [-0.001135972751027; -0.000000027483627; 0.001136000234654];
 %! Yref = [0.617234887614937, 0.000006153591397, 0.382758958793666];
 %! [t, y] = ode15i (@rob, [0, 100], [1; 0; 0], [-1e-4; 1e-4; 0]);
--- a/scripts/plot/util/private/__print_parse_opts__.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/plot/util/private/__print_parse_opts__.m	Tue Oct 04 07:34:47 2022 -0700
@@ -525,7 +525,7 @@
 
 
 ## Test blocks are not allowed (and not needed) for private functions
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ();
 %! assert (opts.devopt, "pswrite");
 %! assert (opts.use_color, 1);
@@ -533,11 +533,11 @@
 %! assert (opts.canvas_size, [576, 432]);
 %! assert (opts.ghostscript.device, "pswrite");
 
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ("test.pdf", "-S640,480");
 %! assert (opts.canvas_size, [307.2, 230.4], 0.1);
 
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ("-dpsc", "-append", "-loose");
 %! assert (opts.devopt, "pswrite");
 %! assert (opts.send_to_printer, true);
@@ -546,14 +546,14 @@
 %! assert (opts.ghostscript.device, "pswrite");
 %! assert (opts.ghostscript.epscrop, false);
 
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ("-deps", "-tight");
 %! assert (opts.tight, true);
 %! assert (opts.send_to_printer, true);
 %! assert (opts.use_color, -1);
 %! assert (opts.ghostscript.device, "");
 
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ("-djpg", "foobar", "-mono", "-loose");
 %! assert (opts.devopt, "jpeg");
 %! assert (opts.name, "foobar.jpg");
@@ -565,7 +565,7 @@
 %! assert (opts.printer, "");
 %! assert (opts.use_color, -1);
 
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ("-ddeskjet", "foobar", "-mono", "-Pmyprinter");
 %! assert (opts.ghostscript.output, "foobar.deskjet");
 %! assert (opts.ghostscript.device, "deskjet");
@@ -574,7 +574,7 @@
 %! assert (opts.printer, "-Pmyprinter");
 %! assert (opts.use_color, -1);
 
-#%!test
+%!#test
 %! opts = __print_parse_opts__ ("-f5", "-dljet3");
 %! assert (opts.ghostscript.device, "ljet3");
 %! assert (strfind (opts.ghostscript.output, ".ljet3"));
--- a/scripts/sparse/ichol.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/sparse/ichol.m	Tue Oct 04 07:34:47 2022 -0700
@@ -364,7 +364,7 @@
 
 ## ICHOLT tests
 
-#%!test
+%!#test
 %! opts.type = "ict";
 %! opts.droptol = 1e-1;
 %! opts.michol = "off";
@@ -376,8 +376,8 @@
 %! opts.shape = "lower";
 %! L = ichol (A1, opts);
 %! assert (norm (A1 - L * L', "fro") / norm (A1, "fro"), 0.2065, 1e-4);
-%!
-#%!test
+
+%!#test
 %! opts.type = "ict";
 %! opts.droptol = 1e-1;
 %! opts.michol = "on";
@@ -390,7 +390,7 @@
 %! opts.diagcomp = 3e-3;
 %! L = ichol (A1, opts);
 %! assert (norm (A1 - L * L', "fro") / norm (A1, "fro"), 0.3266, 1e-4);
-%!
+
 %!test
 %! opts.type = "ict";
 %! opts.droptol = 1e-1;
@@ -400,7 +400,7 @@
 %! opts.michol = "on";
 %! L = ichol (A2, opts);
 %! assert (norm (A2 - L*L', "fro") / norm (A2, "fro"), 0.2377, 1e-4);
-%!
+
 %!test
 %! opts.type = "ict";
 %! opts.droptol = 1e-1;
@@ -410,7 +410,7 @@
 %! opts.michol = "on";
 %! L = ichol (A3, opts);
 %! assert (norm (A3 - L*L', "fro") / norm (A3, "fro"), eps, eps);
-%!
+
 %!test
 %! opts.type = "ict";
 %! opts.droptol = 1e-1;
@@ -420,7 +420,7 @@
 %! opts.michol = "on";
 %! L = ichol (A4, opts);
 %! assert (norm (A4 - L*L', "fro") / norm (A4, "fro"), 0.2118, 1e-4);
-%!
+
 %!test
 %! opts.type = "ict";
 %! opts.droptol = 1e-1;
--- a/scripts/statistics/discrete_rnd.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/statistics/discrete_rnd.m	Tue Oct 04 07:34:47 2022 -0700
@@ -88,7 +88,7 @@
 %!assert (class (discrete_rnd (1:2, 1:2)), "double")
 %!assert (class (discrete_rnd (single (1:2), 1:2)), "single")
 ## FIXME: Maybe this should work, maybe it shouldn't.
-#%!assert (class (discrete_rnd (1:2, single(1:2))), "single")
+%!#assert (class (discrete_rnd (1:2, single(1:2))), "single")
 
 ## Test input validation
 %!error <Invalid call> discrete_rnd ()
--- a/scripts/strings/isstring.m	Mon Oct 03 18:06:55 2022 -0700
+++ b/scripts/strings/isstring.m	Tue Oct 04 07:34:47 2022 -0700
@@ -55,7 +55,7 @@
 %!assert (isstring (1), false)
 %!assert (isstring ('a'), false)
 ## FIXME: when string arrays are implemented, this should return true.
-#%!assert (isstring ("b"), true)
+%!#assert (isstring ("b"), true)
 %!assert (isstring ({'a'}), false)
 %!assert (isstring ({"b"}), false)