Mercurial > hg > octave-jordi
changeset 19669:e5facc6eec13
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.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 07 Feb 2015 20:55:39 -0800 |
parents | 2099e00b1833 |
children | 322d0fe84a8c |
files | scripts/image/ind2rgb.m scripts/linear-algebra/condest.m scripts/linear-algebra/logm.m scripts/polynomial/polyfit.m scripts/testfun/__printf_assert__.m scripts/testfun/__prog_output_assert__.m test/parser.tst |
diffstat | 7 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/image/ind2rgb.m +++ b/scripts/image/ind2rgb.m @@ -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));
--- a/scripts/linear-algebra/condest.m +++ b/scripts/linear-algebra/condest.m @@ -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);
--- a/scripts/linear-algebra/logm.m +++ b/scripts/linear-algebra/logm.m @@ -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))))
--- a/scripts/polynomial/polyfit.m +++ b/scripts/polynomial/polyfit.m @@ -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);
--- a/scripts/testfun/__printf_assert__.m +++ b/scripts/testfun/__printf_assert__.m @@ -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
--- a/scripts/testfun/__prog_output_assert__.m +++ b/scripts/testfun/__prog_output_assert__.m @@ -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")