Change 13890 by jhi@alpha on 2001/12/26 17:47:57

        Net::Ping isn't going to work much without
        the Socket extension; fail more gracefully.

Affected files ...

.... //depot/perl/lib/Net/Ping/t/100_load.t#5 edit
.... //depot/perl/lib/Net/Ping/t/110_icmp_inst.t#5 edit
.... //depot/perl/lib/Net/Ping/t/120_udp_inst.t#5 edit
.... //depot/perl/lib/Net/Ping/t/130_tcp_inst.t#5 edit
.... //depot/perl/lib/Net/Ping/t/140_stream_inst.t#2 edit
.... //depot/perl/lib/Net/Ping/t/200_ping_tcp.t#5 edit
.... //depot/perl/lib/Net/Ping/t/300_ping_stream.t#2 edit

Differences ...

==== //depot/perl/lib/Net/Ping/t/100_load.t#5 (text) ====
Index: perl/lib/Net/Ping/t/100_load.t
--- perl/lib/Net/Ping/t/100_load.t.~1~  Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/100_load.t      Wed Dec 26 11:00:05 2001
@@ -3,6 +3,13 @@
 
 ######################### We start with some black magic to print on failure.
 
+BEGIN {
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
+}
+
 use Test;
 BEGIN { plan tests => 1; $loaded = 0}
 END { ok $loaded;}

==== //depot/perl/lib/Net/Ping/t/110_icmp_inst.t#5 (text) ====
Index: perl/lib/Net/Ping/t/110_icmp_inst.t
--- perl/lib/Net/Ping/t/110_icmp_inst.t.~1~     Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/110_icmp_inst.t Wed Dec 26 11:00:05 2001
@@ -1,6 +1,13 @@
 # Test to make sure object can be instantiated for icmp protocol.
 # Root access is required to actually perform icmp testing.
 
+BEGIN {
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
+}
+
 use Test;
 use Net::Ping;
 plan tests => 2;

==== //depot/perl/lib/Net/Ping/t/120_udp_inst.t#5 (text) ====
Index: perl/lib/Net/Ping/t/120_udp_inst.t
--- perl/lib/Net/Ping/t/120_udp_inst.t.~1~      Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/120_udp_inst.t  Wed Dec 26 11:00:05 2001
@@ -1,6 +1,13 @@
 # Test to make sure object can be instantiated for udp protocol.
 # I do not know of any servers that support udp echo anymore.
 
+BEGIN {
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
+}
+
 use Test;
 use Net::Ping;
 plan tests => 2;

==== //depot/perl/lib/Net/Ping/t/130_tcp_inst.t#5 (text) ====
Index: perl/lib/Net/Ping/t/130_tcp_inst.t
--- perl/lib/Net/Ping/t/130_tcp_inst.t.~1~      Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/130_tcp_inst.t  Wed Dec 26 11:00:05 2001
@@ -1,5 +1,12 @@
 # Test to make sure object can be instantiated for tcp protocol.
 
+BEGIN {
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
+}
+
 use Test;
 use Net::Ping;
 plan tests => 2;

==== //depot/perl/lib/Net/Ping/t/140_stream_inst.t#2 (text) ====
Index: perl/lib/Net/Ping/t/140_stream_inst.t
--- perl/lib/Net/Ping/t/140_stream_inst.t.~1~   Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/140_stream_inst.t       Wed Dec 26 11:00:05 2001
@@ -1,5 +1,12 @@
 # Test to make sure object can be instantiated for stream protocol.
 
+BEGIN {
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
+}
+
 use Test;
 use Net::Ping;
 plan tests => 2;

==== //depot/perl/lib/Net/Ping/t/200_ping_tcp.t#5 (text) ====
Index: perl/lib/Net/Ping/t/200_ping_tcp.t
--- perl/lib/Net/Ping/t/200_ping_tcp.t.~1~      Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/200_ping_tcp.t  Wed Dec 26 11:00:05 2001
@@ -7,6 +7,10 @@
        chdir 't' if -d 't';
        @INC = qw(../lib);
     }
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
 }
 
 # Remote network test using tcp protocol.

==== //depot/perl/lib/Net/Ping/t/300_ping_stream.t#2 (text) ====
Index: perl/lib/Net/Ping/t/300_ping_stream.t
--- perl/lib/Net/Ping/t/300_ping_stream.t.~1~   Wed Dec 26 11:00:05 2001
+++ perl/lib/Net/Ping/t/300_ping_stream.t       Wed Dec 26 11:00:05 2001
@@ -7,6 +7,10 @@
        chdir 't' if -d 't';
        @INC = qw(../lib);
     }
+    unless (eval "require Socket") {
+       print "1..0 # Skip: no Socket\n";
+       exit;
+    }
 }
 
 # Test of stream protocol using loopback interface.
End of Patch.

Reply via email to