# HG changeset patch # User Rik # Date 1423371339 28800 # Node ID e5facc6eec13db98bf901d9dee1c5fc38e441ea1 # Parent 2099e00b18330eca992ec385757219a04f533a53 Silence warning messages in %!test code. * ind2rgb.m: Turn off "Octave:ind2rgb:invalid-idx-img" locally. * condest.m: Turn off "Octave:nearly-singular-matrix" locally. * logm.m: Turn off "Octave:logm:non-principal" locally. * polyfit.m: Turn off "Octave:nearly-singular-matrix" locally. * __printf_assert__.m: Initialize global _assert_printf to empty string to avoid num-to-str warning later. * __prog_output_assert__.m: Initialize global _assert_printf to empty string to avoid num-to-str warning later. . * parser.tst: Turn off "Octave:num-to-str" locally. diff -r 2099e00b1833 -r e5facc6eec13 scripts/image/ind2rgb.m --- a/scripts/image/ind2rgb.m Sat Feb 07 11:32:47 2015 -0500 +++ b/scripts/image/ind2rgb.m Sat Feb 07 20:55:39 2015 -0800 @@ -92,6 +92,7 @@ %! assert (ergb, rgb); %!test %! ## Check that values below lower bound are mapped to first color value +%! warning ("off", "Octave:ind2rgb:invalid-idx-img", "local"); %! rgb = ind2rgb ([-1 0 2], gray (64)); %! assert (rgb(:,1:2,:), zeros (1,2,3)); %! assert (rgb(:,3,:), 1/63 * ones (1,1,3)); diff -r 2099e00b1833 -r e5facc6eec13 scripts/linear-algebra/condest.m --- a/scripts/linear-algebra/condest.m Sat Feb 07 11:32:47 2015 -0500 +++ b/scripts/linear-algebra/condest.m Sat Feb 07 20:55:39 2015 -0800 @@ -233,6 +233,7 @@ %! assert (cA, cA_test, -2^-6); %!test +%! warning ("off", "Octave:nearly-singular-matrix", "local"); %! N = 12; %! A = hilb (N); %! [rcondA, v] = condest (A); diff -r 2099e00b1833 -r e5facc6eec13 scripts/linear-algebra/logm.m --- a/scripts/linear-algebra/logm.m Sat Feb 07 11:32:47 2015 -0500 +++ b/scripts/linear-algebra/logm.m Sat Feb 07 20:55:39 2015 -0800 @@ -161,7 +161,9 @@ %!assert (norm (logm ([1 -1;0 1]) - [0 -1; 0 0]) < 1e-5) -%!assert (norm (expm (logm ([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5) +%!test +%! warning ("off", "Octave:logm:non-principal", "local"); +%! assert (norm (expm (logm ([-1 2 ; 4 -1])) - [-1 2 ; 4 -1]) < 1e-5); %!assert (logm ([1 -1 -1;0 1 -1; 0 0 1]), [0 -1 -1.5; 0 0 -1; 0 0 0], 1e-5) %!assert (logm (10), log (10)) %!assert (full (logm (eye (3))), logm (full (eye (3)))) diff -r 2099e00b1833 -r e5facc6eec13 scripts/polynomial/polyfit.m --- a/scripts/polynomial/polyfit.m Sat Feb 07 11:32:47 2015 -0500 +++ b/scripts/polynomial/polyfit.m Sat Feb 07 20:55:39 2015 -0800 @@ -171,6 +171,7 @@ ## variable is not normalized properly. ## Also check the usage of 2nd & 3rd output arguments. %!test +%! warning ("off", "Octave:nearly-singular-matrix", "local"); %! x = [ -1196.4, -1195.2, -1194, -1192.8, -1191.6, -1190.4, -1189.2, -1188, ... %! -1186.8, -1185.6, -1184.4, -1183.2, -1182]; %! y = [ 315571.7086, 315575.9618, 315579.4195, 315582.6206, 315585.4966, ... @@ -188,6 +189,7 @@ %! assert (p, p0, 1000*eps); %!test +%! warning ("off", "Octave:nearly-singular-matrix", "local"); %! x = 1000 + (-5:5); %! xn = (x - mean (x)) / std (x); %! pn = ones (1,5); diff -r 2099e00b1833 -r e5facc6eec13 scripts/testfun/__printf_assert__.m --- a/scripts/testfun/__printf_assert__.m Sat Feb 07 11:32:47 2015 -0500 +++ b/scripts/testfun/__printf_assert__.m Sat Feb 07 20:55:39 2015 -0800 @@ -22,7 +22,7 @@ ## @end deftypefn function __printf_assert__ (varargin) - global _assert_printf; + global _assert_printf = ""; _assert_printf = cat (2, _assert_printf, sprintf (varargin{:})); endfunction diff -r 2099e00b1833 -r e5facc6eec13 scripts/testfun/__prog_output_assert__.m --- a/scripts/testfun/__prog_output_assert__.m Sat Feb 07 11:32:47 2015 -0500 +++ b/scripts/testfun/__prog_output_assert__.m Sat Feb 07 20:55:39 2015 -0800 @@ -22,7 +22,7 @@ ## @end deftypefn function ret = __prog_output_assert__ (str) - global _assert_printf; + global _assert_printf = ""; if (isempty (_assert_printf)) ret = isempty (str); elseif (_assert_printf(end) == "\n") diff -r 2099e00b1833 -r e5facc6eec13 test/parser.tst --- a/test/parser.tst Sat Feb 07 11:32:47 2015 -0500 +++ b/test/parser.tst Sat Feb 07 20:55:39 2015 -0800 @@ -293,6 +293,7 @@ %! assert (xyz, 1); %!test +%! warning ("off", "Octave:num-to-str", "local"); %! a = [97 ... % comment %! 'b']; %! assert (a, 'ab');