changeset 16900:434a0b29ab12

Add xtest for findobj() for pecedence of logical operations. * scripts/plot/findobj.m: Add xtest to indicate logical operations do not respect precedence. While adding the test, remove "drawnow()" from earlier tests.
author Ben Abbott <bpabbott@mac.com>
date Fri, 05 Jul 2013 07:12:18 -0400
parents 55caca526827
children 861516dcad19
files scripts/plot/findobj.m
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/findobj.m	Thu Jul 04 20:10:25 2013 +0100
+++ b/scripts/plot/findobj.m	Fri Jul 05 07:12:18 2013 -0400
@@ -318,7 +318,6 @@
 %!   set (h3, 'tag', '3')
 %!   h4 = subplot (2, 2, 4);
 %!   set (h4, 'tag', '4')
-%!   drawnow ()
 %!   h = findobj (hf, 'type', 'axes', '-not', 'tag', '1');
 %! unwind_protect_cleanup
 %!   close (hf);
@@ -336,7 +335,6 @@
 %!   set (h3, 'userdata', struct ('column', 1, 'row', 2));
 %!   h4 = subplot (2, 2, 4);
 %!   set (h4, 'userdata', struct ('column', 2, 'row', 2));
-%!   drawnow ()
 %!   h = findobj (hf, 'type', 'axes', '-not', 'userdata', ...
 %!                struct ('column', 1, 'row', 1));
 %! unwind_protect_cleanup
@@ -344,3 +342,16 @@
 %! end_unwind_protect
 %! assert (h, [h2; h3; h4])
 
+%!xtest
+%! hf = figure ("visible", "off");
+%! unwind_protect
+%!   ha = axes ();
+%!   plot (1:10);
+%!   h = findobj (hf, 'type', 'figure', ...
+%!                '-or', 'parent', 1, ...
+%!                '-and', 'type', 'axes')
+%! unwind_protect_cleanup
+%!   close (hf)
+%! end_unwind_protect
+%! assert (h, [hf; ha])
+