5 print "1..0 # Skip: Test requires Test::More module\n";
11 $tests += 2 if Win32::IsWinNT();
15 # test Win32::DomainName()
16 if (Win32::IsWinNT()) {
17 my $domain = eval { Win32::DomainName() };
19 skip('The Workstation service has not been started', 2) if (Win32::GetLastError() == 2138);
20 is( $@, '', "Win32::DomainName()" );
21 like( $domain, '/^[a-zA-Z0-9!@#$%^&()_\'{}.~-]+$/', " - checking returned domain" );
25 # test Win32::GetArchName()
26 my $archname = eval { Win32::GetArchName() };
27 is( $@, '', "Win32::GetArchName()" );
28 cmp_ok( length($archname), '>=', 3, " - checking returned architecture name" );
30 # test Win32::GetChipName()
31 my $chipname = eval { Win32::GetChipName() };
32 is( $@, '', "Win32::GetChipName()" );
33 cmp_ok( length($chipname), '>=', 3, " - checking returned chip name" );
35 # test Win32::GetOSName()
37 my $osname = eval { Win32::GetOSName() };
38 is( $@, '', "Win32::GetOSName() in scalar context" );
39 cmp_ok( length($osname), '>', 3, " - checking returned OS name" );
42 my ($osname2, $desc) = eval { Win32::GetOSName() };
43 is( $@, '', "Win32::GetOSName() in list context" );
44 cmp_ok( length($osname2), '>', 3, " - checking returned OS name" );
45 ok( defined($desc), " - checking returned description" );
46 is( $osname2, $osname, " - checking that OS name is the same in both calls" );
48 # test Win32::LoginName()
49 my $login = eval { Win32::LoginName() };
50 is( $@, '', "Win32::LoginName()" );
51 cmp_ok( length($login), '>', 1, " - checking returned login name" );
53 # test Win32::NodeName()
54 my $nodename = eval { Win32::NodeName() };
55 is( $@, '', "Win32::NodeName()" );
56 cmp_ok( length($nodename), '>', 1, " - checking returned node name" );