From 73a84886d1053e072707208aabf49daaf75ad2af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Fri, 12 Jun 2015 18:19:43 +0200 Subject: [PATCH] Silence "masks earlier declaration in same scope" warnings when executing tests. --- testcases/t/113-urgent.t | 18 +++--- testcases/t/141-resize.t | 9 +-- testcases/t/185-scratchpad.t | 2 +- testcases/t/210-mark-unmark.t | 20 ++++--- testcases/t/231-ipc-floating-event.t | 2 +- testcases/t/232-ipc-window-urgent.t | 2 +- testcases/t/235-check-config-no-x.t | 10 ++-- testcases/t/240-focus-on-window-activation.t | 62 ++++++++++---------- testcases/t/242-no-focus.t | 26 ++++---- 9 files changed, 80 insertions(+), 71 deletions(-) diff --git a/testcases/t/113-urgent.t b/testcases/t/113-urgent.t index 3b82fe22..e88c37a2 100644 --- a/testcases/t/113-urgent.t +++ b/testcases/t/113-urgent.t @@ -53,10 +53,10 @@ font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 force_display_urgency_hint 0ms EOT -my $type; +my ($type, $tmp, $w1, $w2); for ($type = 1; $type <= 2; $type++) { my $pid = launch_with_config($config); - my $tmp = fresh_workspace; + $tmp = fresh_workspace; ##################################################################### # Create two windows and put them in stacking mode @@ -269,8 +269,8 @@ for ($type = 1; $type <= 2; $type++) { my $ws1 = fresh_workspace; my $ws2 = fresh_workspace; cmd "workspace $ws1"; - my $w1 = open_window; - my $w2 = open_window; + $w1 = open_window; + $w2 = open_window; cmd "workspace $ws2"; sync_with_i3; set_urgency($w1, 1, $type); @@ -284,10 +284,10 @@ for ($type = 1; $type <= 2; $type++) { ############################################################################## # Check if urgent flag can be unset if we move the window out of the container ############################################################################## - my $tmp = fresh_workspace; + $tmp = fresh_workspace; cmd 'layout tabbed'; - my $w1 = open_window; - my $w2 = open_window; + $w1 = open_window; + $w2 = open_window; sync_with_i3; cmd '[id="' . $w2->id . '"] focus'; sync_with_i3; @@ -316,8 +316,8 @@ for ($type = 1; $type <= 2; $type++) { my $tmp_target = fresh_workspace; cmd 'workspace ' . $tmp_source; sync_with_i3; - my $w1 = open_window; - my $w2 = open_window; + $w1 = open_window; + $w2 = open_window; sync_with_i3; cmd '[id="' . $w1->id . '"] focus'; sync_with_i3; diff --git a/testcases/t/141-resize.t b/testcases/t/141-resize.t index 97315c3d..c5e61a32 100644 --- a/testcases/t/141-resize.t +++ b/testcases/t/141-resize.t @@ -17,6 +17,7 @@ # Tests resizing tiling containers use i3test; +my ($left, $right); my $tmp = fresh_workspace; cmd 'split v'; @@ -84,8 +85,8 @@ cmp_float($nodes->[1]->{percent}, 0.75, 'bottom window got 75%'); $tmp = fresh_workspace; -my $left = open_window; -my $right = open_window; +$left = open_window; +$right = open_window; cmd 'split v'; @@ -261,8 +262,8 @@ cmp_ok($content[0]->{rect}->{width}, '==', $oldrect->{width}, 'width the same as $tmp = fresh_workspace; -my $left = open_floating_window; -my $right = open_floating_window; +$left = open_floating_window; +$right = open_floating_window; sub get_floating_rect { my ($window_id) = @_; diff --git a/testcases/t/185-scratchpad.t b/testcases/t/185-scratchpad.t index edfc46e0..eeaee449 100644 --- a/testcases/t/185-scratchpad.t +++ b/testcases/t/185-scratchpad.t @@ -377,7 +377,7 @@ sub verify_scratchpad_move_with_visible_scratch_con { # this should bring up window 1 cmd 'scratchpad show'; - my $ws = get_ws($first); + $ws = get_ws($first); is(scalar @{$ws->{floating_nodes}}, 1, 'one floating node on ws1'); is($x->input_focus, $window1->id, "showed the correct scratchpad window1"); diff --git a/testcases/t/210-mark-unmark.t b/testcases/t/210-mark-unmark.t index 99fc92c8..93b26d94 100644 --- a/testcases/t/210-mark-unmark.t +++ b/testcases/t/210-mark-unmark.t @@ -18,6 +18,8 @@ use i3test; use List::Util qw(first); +my ($con, $first, $second); + sub get_marks { return i3(get_socket_path())->get_marks->recv; } @@ -89,8 +91,8 @@ is_deeply(get_marks(), [], 'all marks removed'); # check that only the latter is marked ############################################################## -my $first = open_window; -my $second = open_window; +$first = open_window; +$second = open_window; cmd 'mark important'; cmd 'focus left'; @@ -103,7 +105,7 @@ ok(!get_mark_for_window_on_workspace($tmp, $second), 'second container lost the # 5: mark a con, toggle the mark, check that the mark is gone ############################################################## -my $con = open_window; +$con = open_window; cmd 'mark important'; cmd 'mark --toggle important'; ok(!get_mark_for_window_on_workspace($tmp, $con), 'container no longer has the mark'); @@ -112,7 +114,7 @@ ok(!get_mark_for_window_on_workspace($tmp, $con), 'container no longer has the m # 6: toggle a mark on an unmarked con, check it is marked ############################################################## -my $con = open_window; +$con = open_window; cmd 'mark --toggle important'; is(get_mark_for_window_on_workspace($tmp, $con), 'important', 'container now has the mark'); @@ -121,7 +123,7 @@ is(get_mark_for_window_on_workspace($tmp, $con), 'important', 'container now has # with the new mark ############################################################## -my $con = open_window; +$con = open_window; cmd 'mark boring'; cmd 'mark --toggle important'; is(get_mark_for_window_on_workspace($tmp, $con), 'important', 'container has the most recent mark'); @@ -131,8 +133,8 @@ is(get_mark_for_window_on_workspace($tmp, $con), 'important', 'container has the # check only the latter has the mark ############################################################## -my $first = open_window; -my $second = open_window; +$first = open_window; +$second = open_window; cmd 'mark important'; cmd 'focus left'; @@ -146,8 +148,8 @@ ok(!get_mark_for_window_on_workspace($tmp, $second), 'second containr no longer # it fails ############################################################## -my $first = open_window(wm_class => 'iamnotunique'); -my $second = open_window(wm_class => 'iamnotunique'); +$first = open_window(wm_class => 'iamnotunique'); +$second = open_window(wm_class => 'iamnotunique'); my $result = cmd "[instance=iamnotunique] mark important"; diff --git a/testcases/t/231-ipc-floating-event.t b/testcases/t/231-ipc-floating-event.t index c2de64e4..4c172ff5 100644 --- a/testcases/t/231-ipc-floating-event.t +++ b/testcases/t/231-ipc-floating-event.t @@ -50,7 +50,7 @@ is($e->{container}->{floating}, 'user_on', 'the container should be floating'); $cv = AnyEvent->condvar; cmd '[id="' . $win->{id} . '"] floating disable'; -my $e = $cv->recv; +$e = $cv->recv; isnt($e, 0, 'disabling floating on a container should send an ipc window event'); is($e->{container}->{window}, $win->{id}, 'the event should contain information about the window'); diff --git a/testcases/t/232-ipc-window-urgent.t b/testcases/t/232-ipc-window-urgent.t index 2ac9ecbb..09226ff1 100644 --- a/testcases/t/232-ipc-window-urgent.t +++ b/testcases/t/232-ipc-window-urgent.t @@ -59,7 +59,7 @@ is($event->{container}->{urgent}, 1, 'the container should be urgent'); $cv = AnyEvent->condvar; $win->delete_hint('urgency'); -my $event = $cv->recv; +$event = $cv->recv; isnt($event, 0, 'an urgent con should emit the window::urgent event'); is($event->{container}->{window}, $win->{id}, 'the event should contain information about the window'); diff --git a/testcases/t/235-check-config-no-x.t b/testcases/t/235-check-config-no-x.t index 614d6b3a..ec17353e 100644 --- a/testcases/t/235-check-config-no-x.t +++ b/testcases/t/235-check-config-no-x.t @@ -20,6 +20,8 @@ use i3test i3_autostart => 0; use File::Temp qw(tempfile); +my ($cfg, $ret, $out); + sub check_config { my ($config) = @_; my ($fh, $tmpfile) = tempfile(UNLINK => 1); @@ -35,12 +37,12 @@ sub check_config { # 1: test with a bogus configuration file ################################################################################ -my $cfg = < 0; use List::Util qw(first); +my ($config, $pid, $first, $second, $ws1, $ws2); + sub send_net_active_window { my ($id) = @_; @@ -46,18 +48,18 @@ sub get_urgency_for_window_on_workspace { # check that the urgent flag is set and focus is not lost. ##################################################################### -my $config = <id); sync_with_i3; @@ -72,19 +74,19 @@ exit_gracefully($pid); # visible, check that the urgent flag is set and focus is not lost. ##################################################################### -my $config = <id); sync_with_i3; @@ -100,18 +102,18 @@ exit_gracefully($pid); # check that the focus is switched. ##################################################################### -my $config = <id); sync_with_i3; @@ -126,19 +128,19 @@ exit_gracefully($pid); # visible, check that the focus switched. ##################################################################### -my $config = <id); sync_with_i3; @@ -154,18 +156,18 @@ exit_gracefully($pid); # check that nothing happens. ##################################################################### -my $config = <id); sync_with_i3; @@ -180,19 +182,19 @@ exit_gracefully($pid); # visible, check that nothing happens. ##################################################################### -my $config = <id); sync_with_i3; diff --git a/testcases/t/242-no-focus.t b/testcases/t/242-no-focus.t index b3983436..143ae5cf 100644 --- a/testcases/t/242-no-focus.t +++ b/testcases/t/242-no-focus.t @@ -18,21 +18,23 @@ # Ticket: #1416 use i3test i3_autostart => 0; +my ($config, $pid, $ws, $first, $second, $focused); + ##################################################################### # 1: open a window and check that it takes focus ##################################################################### -my $config = < 'notme'); +$ws = fresh_workspace; +$first = open_window; +$focused = get_focused($ws); +$second = open_window(wm_class => 'notme'); is(get_focused($ws), $focused, 'focus has not changed'); -- 2.39.2