# HG changeset patch # User Mike Miller # Date 1423326767 18000 # Node ID 2099e00b18330eca992ec385757219a04f533a53 # Parent b2fe4dbe5266f5119090e61804b90ab72a3eab94 colormaps.tst: Don't show a figure during 'make check' * colormaps.tst: Create an invisible figure to prevent empty figure from showing during tests. Add unwind_protect block to close figure. diff -r b2fe4dbe5266 -r 2099e00b1833 test/colormaps.tst --- a/test/colormaps.tst Sat Feb 07 10:47:25 2015 -0500 +++ b/test/colormaps.tst Sat Feb 07 11:32:47 2015 -0500 @@ -17,21 +17,26 @@ ## . %!test -%! all_colormaps = colormap ("list"); +%! hf = figure ("visible", "off"); +%! unwind_protect +%! all_colormaps = colormap ("list"); %! -%! assert (numel (all_colormaps) > 0) +%! assert (numel (all_colormaps) > 0) %! -%! for i = 1:numel (all_colormaps) -%! f = str2func (all_colormaps{i}); +%! for i = 1:numel (all_colormaps) +%! f = str2func (all_colormaps{i}); %! -%! assert (iscolormap (f (1))) -%! assert (iscolormap (f (12))) -%! assert (iscolormap (f (200))) +%! assert (iscolormap (f (1))) +%! assert (iscolormap (f (12))) +%! assert (iscolormap (f (200))) %! -%! ## bug #44070 -%! assert (class (f (uint8 (12))), "double") -%! assert (iscolormap (f (uint8 (12)))) +%! ## bug #44070 +%! assert (class (f (uint8 (12))), "double") +%! assert (iscolormap (f (uint8 (12)))) %! -%! assert (f (0), zeros (0, 3)) -%! endfor +%! assert (f (0), zeros (0, 3)) +%! endfor +%! unwind_protect_cleanup +%! close (hf); +%! end_unwind_protect