# HG changeset patch # User Ben Abbott # Date 1373022738 14400 # Node ID 434a0b29ab12d5219d58d3fa5f9fa2ab1adcaeef # Parent 55caca5268279d150b4ba1e3a715cf1f1fafe18f 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. diff --git a/scripts/plot/findobj.m b/scripts/plot/findobj.m --- a/scripts/plot/findobj.m +++ b/scripts/plot/findobj.m @@ -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]) +