changeset 27555:c2f2fb1df9ed

findall.m: Fix failing test after cset d0f778462a51 (bug #55970) * findall.m (test): Make test not depend on the chosen toolkit and on the default figure menu structure.
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Thu, 24 Oct 2019 22:33:37 +0200
parents d0f778462a51
children 410622ac120f
files scripts/plot/util/findall.m
diffstat 1 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/util/findall.m	Fri Sep 27 13:14:13 2019 +0200
+++ b/scripts/plot/util/findall.m	Thu Oct 24 22:33:37 2019 +0200
@@ -50,19 +50,26 @@
 endfunction
 
 
-%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ("qt");
+%!test
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   h = findall (hf);
-%!   all_handles(1) = {"figure"};
-%!   all_handles(2,1) = {"uitoolbar"};
-%!   all_handles(3:5) = {"uimenu"};
-%!   all_handles([6:7, 9]) = {"uipushtool"};
-%!   all_handles([8, 10:13]) = {"uitoggletool"};
-%!   all_handles(14:33) = {"uimenu"};
-%!   assert (get (h, "type"), all_handles);
+%!   types = {"uitoolbar"};
+%!   htb = uitoolbar (hf);
+%!   types = [types {"uimenu", "uimenu", "uimenu", ...
+%!                   "uimenu", "uimenu", "uimenu"}];
+%!   hm1 = uimenu (hf, "label", "menu1", "handlevisibility", "off");
+%!   uimenu (hm1, "label", "menu1");
+%!   hm2 = uimenu (hf, "label", "menu2", "handlevisibility", "off");
+%!   uimenu (hm2, "label", "menu2");
+%!   hm3 = uimenu (hf, "label", "menu3");
+%!   uimenu (hm3, "label", "menu3");
+%!   types = [types {"uipushtool", "uitoggletool", "uipushtool"}];
+%!   uipushtool (htb, "handlevisibility", "off");
+%!   uitoggletool (htb);
+%!   uipushtool (htb);
+%!   h = setxor (findall (hf), h);
+%!   assert (get (h, "type"), types(:));
 %! unwind_protect_cleanup
 %!   close (hf);
-%!   graphics_toolkit (toolkit);
 %! end_unwind_protect