changeset 13846:10a5c8155756

* ov-range.cc: Also disable warning for noninteger index in test.
author John W. Eaton <jwe@octave.org>
date Tue, 08 Nov 2011 14:50:15 -0500
parents 35f59bd285bf
children 9fc597693b0b
files src/ov-range.cc
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/ov-range.cc	Tue Nov 08 11:55:28 2011 -0800
+++ b/src/ov-range.cc	Tue Nov 08 14:50:15 2011 -0500
@@ -661,12 +661,19 @@
 /*
 %!test
 %! x = 0:10;
-%! save = allow_noninteger_range_as_index (0);
-%! fail ('x(2.1:5)');
-%! assert (x(2:5), 1:4);
-%! allow_noninteger_range_as_index (1);
-%! assert (x(2.49:5), 1:3);
-%! assert (x(2.5:5), 2:4);
-%! assert (x(2.51:5), 2:4);
-%! allow_noninteger_range_as_index (save);
+%! save = allow_noninteger_range_as_index ();
+%! warn_state = warning ("query", "Octave:noninteger-range-as-index");
+%! unwind_protect
+%!   save = allow_noninteger_range_as_index (false);
+%!   fail ('x(2.1:5)');
+%!   assert (x(2:5), 1:4);
+%!   allow_noninteger_range_as_index (true);
+%!   warning ("off", "Octave:noninteger-range-as-index");
+%!   assert (x(2.49:5), 1:3);
+%!   assert (x(2.5:5), 2:4);
+%!   assert (x(2.51:5), 2:4);
+%! unwind_protect_cleanup
+%!   allow_noninteger_range_as_index (save);
+%!   warning (warn_state.state, warn_state.identifier);
+%! end_unwind_protect
 */