On Mon, 17 Sep 2007, Jerry D. Hedden wrote:
> Jan Dubois wrote:
> > That is weird, why does the test fail then.
Doesn't Win32: omainNam
e()
> > on that machine return "MSHOME"? When I
run it on an XP (SP2) machine
> > that is not part of the domain, I get the
workgroup name:
> >
> > C:>perl -MWin32 -e "print Win32: omainNam
e"
> > WORKGROUP
>
> It prints out nothing on my PC. So it appears to be
returning an empty
> string.
It looks like we cannot determine the workgroup name if the
"Workstation"
service isn't running. I therefore removed the Win32: omainNam
e()
test from t/Names.t (patch below is against by local depot
for the
CPAN version, but should otherwise be identical to the
bleadperl one).
Cheers,
-Jan
--- users/jand/Win32/t/Names.t.~1~ Wed Sep 19 15:06:39
2007
+++ users/jand/Win32/t/Names.t Wed Sep 19 15:06:39 2007
 -7,17
+7,10 
}
use Win32;
-my $tests = 14;
-$tests += 2 if Win32::IsWinNT();
+plan tests => 14;
-plan tests => $tests;
-
-# test Win32: omainNam
e()
-if (Win32::IsWinNT()) {
- my $domain = eval { Win32: omainNam
e() };
- is( $ , '', "Win32: omainNam
e()" );
- like( $domain, '/^[a-zA-Z0-9! #$%^&()_'{}.~-]+$/',
" - checking returned domain" );
-}
+# don't test Win32: omainNam
e(), it only works on Windows NT and later,
+# and it may not return anything if the
"Workstation" service is not running.
# test Win32::GetArchName()
my $archname = eval { Win32::GetArchName() };
End of Patch.
|