This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
warnings.t portability tweaks
authorCraig A. Berry <craigberry@mac.com>
Sat, 20 Nov 2004 10:29:47 +0000 (04:29 -0600)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 23 Nov 2004 09:09:57 +0000 (09:09 +0000)
From: "Craig A. Berry" <craigberry@mac.com>
Message-ID: <419F70FB.7000100@mac.com>

p4raw-id: //depot/perl@23525

t/lib/warnings/9uninit
t/lib/warnings/perlio

index 4a3b3a3..d22e4cf 100644 (file)
@@ -1166,7 +1166,6 @@ eval { syswrite $m1, $g1 };
 # eval { syswrite STDERR, $m1 };        # XXX under utf8, can give
 # eval { syswrite STDERR, $m1, $g1 };   # XXX different warnings
 # eval { syswrite STDERR, $m1, $g1, $m2 };
-eval { my $x; flock $x, $g1 };
 eval { my $x; socket $x, $m1, $g1, $m2 };
 eval { my ($x,$y); socketpair $x, $y, $m1, $g1, $m2 };
 EXPECT
@@ -1178,14 +1177,32 @@ Use of uninitialized value $g1 in sysseek at - line 6.
 Use of uninitialized value $m1 in sysseek at - line 6.
 Use of uninitialized value $m1 in ref-to-glob cast at - line 7.
 Use of uninitialized value $g1 in syswrite at - line 7.
-Use of uninitialized value $x in ref-to-glob cast at - line 11.
-Use of uninitialized value $g1 in flock at - line 11.
-Use of uninitialized value $m2 in socket at - line 12.
-Use of uninitialized value $g1 in socket at - line 12.
-Use of uninitialized value $m1 in socket at - line 12.
-Use of uninitialized value $m2 in socketpair at - line 13.
-Use of uninitialized value $g1 in socketpair at - line 13.
-Use of uninitialized value $m1 in socketpair at - line 13.
+Use of uninitialized value $m2 in socket at - line 11.
+Use of uninitialized value $g1 in socket at - line 11.
+Use of uninitialized value $m1 in socket at - line 11.
+Use of uninitialized value $m2 in socketpair at - line 12.
+Use of uninitialized value $g1 in socketpair at - line 12.
+Use of uninitialized value $m1 in socketpair at - line 12.
+########
+use Config; 
+BEGIN { 
+  if ( !$Config{d_flock} &&
+       !$Config{d_fcntl_can_lock} &&
+       !$Config{d_lockf} ) {
+    print <<EOM ;
+SKIPPED
+# flock not present
+EOM
+    exit ;
+  } 
+}
+use warnings 'uninitialized';
+our ($g1);
+
+eval { my $x; flock $x, $g1 };
+EXPECT
+Use of uninitialized value $x in ref-to-glob cast at - line 16.
+Use of uninitialized value $g1 in flock at - line 16.
 ########
 use warnings 'uninitialized';
 my ($m1, $v);
index e84e3de..0ccc5a8 100644 (file)
@@ -44,7 +44,7 @@ EXPECT
 Argument list not closed for PerlIO layer "aa(" at - line 6.
 ########
 
---FILE-- PerlIO/xyz.pm
+--FILE-- PerlIO_test_dir/xyz.pm
 1;
 --FILE--
 # perlio [PerlIO_parse_layers]