1# Test to make sure object can be instantiated for icmp protocol.
2# Root access is required to actually perform icmp testing.
3
4use strict;
5use Config;
6
7BEGIN {
8  unless (eval "require Socket") {
9    print "1..0 \# Skip: no Socket\n";
10    exit;
11  }
12  unless ($Config{d_getpbyname}) {
13    print "1..0 \# Skip: no getprotobyname\n";
14    exit;
15  }
16}
17
18use Test::More tests => 2;
19BEGIN {use_ok('Net::Ping')};
20
21SKIP: {
22  skip "icmp ping requires root privileges.", 1
23    unless &Net::Ping::_isroot;
24  my $p = new Net::Ping "icmp";
25  isa_ok($p, 'Net::Ping', 'object can be instantiated for icmp protocol');
26}
27