1 # Test to make sure object can be instantiated for icmp protocol.
2 # Root access is required to actually perform icmp testing.
7 unless (eval "require Socket") {
8 print "1..0 \# Skip: no Socket\n";
13 use Test::More tests => 2;
14 BEGIN {use_ok('Net::Ping')};
17 skip "icmp ping requires root privileges.", 1
18 if ($> and $^O ne 'VMS' and $^O ne 'cygwin')
19 or (($^O eq 'MSWin32' or $^O eq 'cygwin')
22 and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/));
23 my $p = new Net::Ping "icmp";
24 isa_ok($p, 'Net::Ping', 'object can be instantiated for icmp protocol');
28 return unless $^O eq 'MSWin32' or $^O eq 'cygwin';
29 return unless eval { require Win32 };
30 return unless defined &Win32::IsAdminUser;
31 return Win32::IsAdminUser();