changeset 13123:6efa1a691713

Add further tests for scripts/plot. plot/close.m: Tests added. plot/gca.m, plot/gcbf.m, plot/gcbo.m, plot/hggroup.m, plot/isfigure.m: Ditto. plot/gtext.m, plot/ginput.m: Dummy test added.
author Kai Habel <kai.habel@gmx.de>
date Sun, 11 Sep 2011 18:24:58 +0200
parents f80273b38cc4
children 2ea1658ad049
files scripts/plot/close.m scripts/plot/gca.m scripts/plot/gcbf.m scripts/plot/gcbo.m scripts/plot/ginput.m scripts/plot/gtext.m scripts/plot/hggroup.m scripts/plot/isfigure.m
diffstat 8 files changed, 53 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/close.m
+++ b/scripts/plot/close.m
@@ -79,3 +79,15 @@
   endwhile
 
 endfunction
+
+%!test
+%! hf = figure (1232, "visible", "off");
+%! unwind_protect
+%!   close (1232);
+%!   objs = findobj ("type", "figure");
+%!   assert (isempty (intersect (objs, 1232)));
+%! unwind_protect_cleanup
+%!   if (isfigure (1232))
+%!     close (hf);
+%!   endif
+%! end_unwind_protect
--- a/scripts/plot/gca.m
+++ b/scripts/plot/gca.m
@@ -49,3 +49,12 @@
   endif
 
 endfunction
+
+%!test
+%! hf = figure (1232, "visible", "off");
+%! ax = axes;
+%! unwind_protect  
+%!   assert (gca, ax);
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
--- a/scripts/plot/gcbf.m
+++ b/scripts/plot/gcbf.m
@@ -31,3 +31,6 @@
   [dummy, fig] = gcbo ();
 
 endfunction
+
+%!test
+%! assert (isempty (gcbf ));
--- a/scripts/plot/gcbo.m
+++ b/scripts/plot/gcbo.m
@@ -41,3 +41,6 @@
   endif
 
 endfunction
+
+%!test
+%! assert (isempty (gcbo ));
--- a/scripts/plot/ginput.m
+++ b/scripts/plot/ginput.m
@@ -42,3 +42,7 @@
   endif
 
 endfunction
+
+## Remove from test statistics.  No real tests possible.
+%!test
+%! assert (1);
--- a/scripts/plot/gtext.m
+++ b/scripts/plot/gtext.m
@@ -51,3 +51,6 @@
 
 endfunction
 
+## Remove from test statistics.  No real tests possible.
+%!test
+%! assert (1);
--- a/scripts/plot/hggroup.m
+++ b/scripts/plot/hggroup.m
@@ -41,3 +41,13 @@
   endif
 
 endfunction
+
+%!test
+%! hf = figure (1232, "visible", "off");
+%! unwind_protect  
+%!   h = hggroup;
+%!   assert (findobj (hf, "type", "hggroup"), h);
+%!   assert (get (h, "type"), "hggroup");
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect
--- a/scripts/plot/isfigure.m
+++ b/scripts/plot/isfigure.m
@@ -34,3 +34,12 @@
   endif
 
 endfunction
+
+%!test
+%! hf = figure (1232, "visible", "off");
+%! unwind_protect  
+%!   assert (isfigure (1232));
+%!   assert (!isfigure (-1232));
+%! unwind_protect_cleanup
+%!   close (hf);
+%! end_unwind_protect