82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / Net-Ping / t / 510_ping_udp.t
CommitLineData
c94ff782 1# Test to perform udp protocol testing.
2
f8abf63d 3sub isWindowsVista {
4 return unless $^O eq 'MSWin32' or $^O eq "cygwin";
5 return unless eval { require Win32 };
6 return unless defined &Win32::GetOSName;
7 return Win32::GetOSName() eq "WinVista";
8}
9
c94ff782 10BEGIN {
11 unless (eval "require Socket") {
12 print "1..0 \# Skip: no Socket\n";
13 exit;
14 }
f8abf63d 15 unless (getservbyname('echo', 'udp')) {
7ac0cca8 16 print "1..0 \# Skip: no udp echo port\n";
f8abf63d 17 exit;
18 }
19
20 if(isWindowsVista()) {
21 print "1..0 \# Skip: udp ping blocked by Vista's default settings\n";
c94ff782 22 exit;
23 }
24}
25
26use Test;
27use Net::Ping;
28plan tests => 2;
29
30# Everything loaded fine
31ok 1;
32
33my $p = new Net::Ping "udp";
34ok $p->ping("127.0.0.1");