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