summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-05 20:02:55 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-05 20:02:55 +0000
commit7c7bf78e2115cf1c10624a9f40e98f0bff340218 (patch)
treeaf654ff16d99bb96246cbc035812b56492063def /t
parent29209bc5efc823322ed539ae434cba1765cb5082 (diff)
parentabf95952312f9cf679a3ebd0bb2f1758f1585f0f (diff)
downloadperl-7c7bf78e2115cf1c10624a9f40e98f0bff340218.tar.gz
Integrate with mainperl.
p4raw-id: //depot/cfgperl@3598
Diffstat (limited to 't')
-rwxr-xr-xt/lib/io_udp.t20
1 files changed, 15 insertions, 5 deletions
diff --git a/t/lib/io_udp.t b/t/lib/io_udp.t
index 02112a27e3..8547024df3 100755
--- a/t/lib/io_udp.t
+++ b/t/lib/io_udp.t
@@ -19,9 +19,6 @@ BEGIN {
elsif ($Config{'extensions'} !~ /\bIO\b/) {
$reason = 'IO was not built';
}
- elsif ($^O eq 'os2') {
- $reason = "blocks on OS/2, not debugged yet";
- }
elsif ($^O eq 'apollo') {
$reason = "unknown *FIXME*";
}
@@ -36,6 +33,18 @@ BEGIN {
sub compare_addr {
my $a = shift;
my $b = shift;
+ if (length($a) != length $b) {
+ my $min = (length($a) < length $b) ? length($a) : length $b;
+ if ($min and substr($a, 0, $min) eq substr($b, 0, $min)) {
+ printf "# Apparently: %d bytes junk at the end of %s\n# %s\n",
+ abs(length($a) - length ($b)),
+ $_[length($a) < length ($b) ? 1 : 0],
+ "consider decreasing bufsize of recfrom.";
+ substr($a, $min) = "";
+ substr($b, $min) = "";
+ }
+ return 0;
+ }
my @a = unpack_sockaddr_in($a);
my @b = unpack_sockaddr_in($b);
"$a[0]$a[1]" eq "$b[0]$b[1]";
@@ -65,7 +74,8 @@ print "ok 2\n";
$udpa->send("ok 4\n",0,$udpb->sockname);
-print "not " unless compare_addr($udpa->peername,$udpb->sockname);
+print "not "
+ unless compare_addr($udpa->peername,$udpb->sockname, 'peername', 'sockname');
print "ok 3\n";
my $where = $udpb->recv($buf="",5);
@@ -73,7 +83,7 @@ print $buf;
my @xtra = ();
-unless(compare_addr($where,$udpa->sockname)) {
+unless(compare_addr($where,$udpa->sockname, 'recv name', 'sockname')) {
print "not ";
@xtra = (0,$udpa->sockname);
}