From: Steve Hay Date: Wed, 12 Sep 2007 08:11:46 +0000 (+0000) Subject: Upgrade to Win32-0.31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0130bfd94175b569069a67c8e36c3b9094446d8b;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Win32-0.31 p4raw-id: //depot/perl@31852 --- diff --git a/MANIFEST b/MANIFEST index 7d51b15..1ca6710 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1218,6 +1218,7 @@ ext/Win32/t/GetLongPathName.t See if Win32 extension works ext/Win32/t/GetOSVersion.t See if Win32 extension works ext/Win32/t/GetShortPathName.t See if Win32 extension works ext/Win32/t/GuidGen.t See if Win32 extension works +ext/Win32/t/Names.t See if Win32 extension works ext/Win32/t/Unicode.t See if Win32 extension works ext/Win32/Win32.pm Win32 extension Perl module ext/Win32/Win32.xs Win32 extension external subroutines diff --git a/ext/Win32/Win32.pm b/ext/Win32/Win32.pm index 78faf03..a328016 100644 --- a/ext/Win32/Win32.pm +++ b/ext/Win32/Win32.pm @@ -8,7 +8,7 @@ BEGIN { require DynaLoader; @ISA = qw|Exporter DynaLoader|; - $VERSION = '0.30'; + $VERSION = '0.31'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/ext/Win32/t/GetLongPathName.t b/ext/Win32/t/GetLongPathName.t index 834d8d1..9269346 100644 --- a/ext/Win32/t/GetLongPathName.t +++ b/ext/Win32/t/GetLongPathName.t @@ -29,17 +29,17 @@ push @paths, qw( //.\/./\ ); -my $drive = $ENV{SystemDrive}; +my $drive = $ENV{SYSTEMDRIVE}; if ($drive) { for (@paths) { s/^c:/$drive/; } - push @paths, $ENV{SystemRoot} if $ENV{SystemRoot}; + push @paths, $ENV{SYSTEMROOT} if $ENV{SYSTEMROOT}; } my %expect; @expect{@paths} = map { my $x = $_; $x =~ s,(.[/\\])[/\\]+,$1,g; - $x =~ s,^c,C,; + $x =~ s,^(\w):,\U$1:,; $x } @paths; plan tests => scalar(@paths); diff --git a/ext/Win32/t/Names.t b/ext/Win32/t/Names.t new file mode 100644 index 0000000..414c479 --- /dev/null +++ b/ext/Win32/t/Names.t @@ -0,0 +1,53 @@ +use strict; +BEGIN { + eval "use Test::More"; + return unless $@; + print "1..0 # Skip: Test requires Test::More module\n"; + exit 0; +} +use Win32; + +my $tests = 14; +$tests += 2 if Win32::IsWinNT(); + +plan tests => $tests; + +# test Win32::DomainName() +if (Win32::IsWinNT()) { + my $domain = eval { Win32::DomainName() }; + is( $@, '', "Win32::DomainName()" ); + like( $domain, '/^[a-zA-Z0-9!@#$%^&()_\'{}.~-]+$/', " - checking returned domain" ); +} + +# test Win32::GetArchName() +my $archname = eval { Win32::GetArchName() }; +is( $@, '', "Win32::GetArchName()" ); +cmp_ok( length($archname), '>=', 3, " - checking returned architecture name" ); + +# test Win32::GetChipName() +my $chipname = eval { Win32::GetChipName() }; +is( $@, '', "Win32::GetChipName()" ); +cmp_ok( length($chipname), '>=', 3, " - checking returned chip name" ); + +# test Win32::GetOSName() +# - scalar context +my $osname = eval { Win32::GetOSName() }; +is( $@, '', "Win32::GetOSName() in scalar context" ); +cmp_ok( length($osname), '>', 3, " - checking returned OS name" ); + +# - list context +my ($osname2, $desc) = eval { Win32::GetOSName() }; +is( $@, '', "Win32::GetOSName() in list context" ); +cmp_ok( length($osname), '>', 3, " - checking returned OS name" ); +cmp_ok( length($desc ), '>', 3, " - checking returned description" ); +is( $osname2, $osname, " - checking that OS name is the same in both calls" ); + +# test Win32::LoginName() +my $login = eval { Win32::LoginName() }; +is( $@, '', "Win32::LoginName()" ); +cmp_ok( length($login), '>', 1, " - checking returned login name" ); + +# test Win32::NodeName() +my $nodename = eval { Win32::NodeName() }; +is( $@, '', "Win32::NodeName()" ); +cmp_ok( length($nodename), '>', 1, " - checking returned node name" );