develooper Front page | perl.perl5.porters | Postings from September 2003

[PATCH 5.8.1 @21211] os2_process.t

From:
Ilya Zakharevich
Date:
September 16, 2003 23:21
Subject:
[PATCH 5.8.1 @21211] os2_process.t
Message ID:
20030917062147.GA20400@math.berkeley.edu
This patch fixes failures in os2_process.t and os2_process_kid.t
(OS/2-specific tests) which were happening in subtests 177 and 212.
The tests were failing on systems where the default state of a VIO
(=console) window is maximized.  [The default state can be changed by
Shift-Mouse-click on the "maximize/restore" button in the upper right
corner.]

[I was trying to un-Minimize window by doing Restore or Maximize -
depending on the initial state of the console window.  However, when
the window is Maximized, it is simultaneously moved to the UL corner -
so the effect of Minimize is not reverted; one needs to manually move
the window to the initial position.]

Enjoy,
Ilya

--- ./os2/OS2/Process/t/os2_process.t-pre	Sat Sep 13 12:00:50 2003
+++ ./os2/OS2/Process/t/os2_process.t	Tue Sep 16 19:49:22 2003
@@ -24,7 +24,7 @@ BEGIN {			# Remap I/O to the parent's wi
 }
 
 use strict;
-use Test::More tests => 230;
+use Test::More tests => 232;
 use OS2::Process;
 
 sub SWP_flags ($) {
@@ -407,9 +407,14 @@ ok $my_pos, 'got my position';
   ok IsWindowShowing $k_hwnd, 'kid is showing';
   ok IsWindowVisible $k_hwnd, 'kid is flaged as visible';
   ok IsWindowEnabled $k_hwnd, 'kid is flaged as enabled';
+  SKIP: {
+    skip 'if defaultVIO=MAXIMIZED, new windows are shifted, but maximize to UL corner', 1 unless $fl & 0x800;
+    ok hWindowPos_set({x => $ppos[0], y => $ppos[1]}, $k_hwnd), 'x,y-restore for de-minimization of MAXIMIZED';
+  }
   @nkpos = WindowPos $k_hwnd;
   is_deeply([@ppos[0..5]], [@nkpos[0..5]], 'position restored');
 
+
   # Now the other way
   ok hWindowPos_set( {flags => 0x400}, $k_hwnd), 'set to minimized';
   ok !IsWindowShowing $k_hwnd, 'kid is not showing';
@@ -452,6 +457,10 @@ ok $my_pos, 'got my position';
   ok IsWindowShowing $k_hwnd, 'kid is showing';
   ok IsWindowVisible $k_hwnd, 'kid is flaged as visible';
   ok IsWindowEnabled $k_hwnd, 'kid is flaged as enabled';
+  SKIP: {
+    skip 'if defaultVIO=MAXIMIZED, new windows are shifted, but maximize to UL corner', 1 unless $fl & 0x800;
+    ok hWindowPos_set({x => $ppos[0], y => $ppos[1]}, $k_hwnd), 'x,y-restore for de-minimization of MAXIMIZED';
+  }
   @nkpos = WindowPos $k_hwnd;
   is_deeply([@ppos[0..5]], [@nkpos[0..5]], 'position restored');
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About