[6565f5]: perl / pl-CYG11-fabf0235_Fix_test_50_on_cygwin_WINDOWS.patch Maximize Restore History

Download this file

pl-CYG11-fabf0235_Fix_test_50_on_cygwin_WINDOWS.patch    40 lines (33 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
commit fabf0235d1f46ea9484846b2c6792dd1182f54a2
Author: Reini Urban <rurban@x-ray.at>
Date: Tue Apr 12 12:33:16 2011 +0200
Fix test 50 on cygwin: \WINDOWS
diff --git a/cpan/Win32API-File/t/file.t b/cpan/Win32API-File/t/file.t
index 0039b57..9a0dd88 100644
--- a/cpan/Win32API-File/t/file.t
+++ b/cpan/Win32API-File/t/file.t
@@ -24,7 +24,7 @@ END {print "not ok 1\n" unless $loaded;}
# the ../lib directory in @INC will no longer work once
# we chdir() into the TEMP directory.
-require Win32 unless defined &Win32::FormatMessage;
+use Win32;
use File::Spec;
use Carp;
use Carp::Heavy;
@@ -342,8 +342,9 @@ if( !$ok ) {
}
print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 49
-$ok= -f $let.substr($ENV{WINDIR},3)."/win.ini";
-$ok or print "# ",fileLastError(),"\n";
+my $path = $ENV{WINDIR};
+$ok= -f $let.substr($path,$^O eq 'cygwin'?2:3)."/win.ini";
+$ok or print "# ",$let.substr($path,3)."/win.ini ",fileLastError(),"\n";
print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 50
$ok= DefineDosDevice( DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE
@@ -351,7 +352,6 @@ $ok= DefineDosDevice( DDD_REMOVE_DEFINITION|DDD_EXACT_MATCH_ON_REMOVE
$ok or print "# $let,$dev: ",fileLastError(),"\n";
print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 51
-my $path = $ENV{WINDIR};
my $attrs = GetFileAttributes( $path );
$ok= $attrs != INVALID_FILE_ATTRIBUTES;
$ok or print "# $path gave invalid attribute value, attrs=$attrs: ",fileLastError(),"\n";