summaryrefslogtreecommitdiff
path: root/ext/Socket
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2001-08-29 10:42:54 +0000
committerArtur Bergman <sky@nanisky.com>2001-08-29 10:42:54 +0000
commitd09712d887062ccb5a1104006dc798bcb5502153 (patch)
tree1ef5dccbcc9c1c64957b05b10a899cd4a8a63307 /ext/Socket
parente245830c55d8c69f997346368c4b1b24cd4995a4 (diff)
downloadperl-d09712d887062ccb5a1104006dc798bcb5502153.tar.gz
Added test for pack_addr_in and unpack_addr_in
Nitpik in test 10 p4raw-id: //depot/perl@11787
Diffstat (limited to 'ext/Socket')
-rwxr-xr-xext/Socket/Socket.t11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/Socket/Socket.t b/ext/Socket/Socket.t
index ea3a4be5de..20a57a49b7 100755
--- a/ext/Socket/Socket.t
+++ b/ext/Socket/Socket.t
@@ -13,7 +13,7 @@ BEGIN {
use Socket;
-print "1..11\n";
+print "1..13\n";
if (socket(T,PF_INET,SOCK_STREAM,6)) {
print "ok 1\n";
@@ -93,6 +93,11 @@ if((inet_ntoa((unpack_sockaddr_in(pack_sockaddr_in(100,inet_aton("10.250.230.10"
} else {
print "not ok 9\n";
}
-print ((inet_aton(10.10.10.10) == v10.10.10.10) ? "ok 10\n" : "not ok 10\n");
+print ((inet_aton("10.10.10.10") eq v10.10.10.10) ? "ok 10\n" : "not ok 10\n");
print ((inet_ntoa(v10.10.10.10) eq '10.10.10.10') ? "ok 11\n" : "not ok 11\n");
-
+{
+ my ($port,$addr) = unpack_sockaddr_in(pack_sockaddr_in(100,v10.10.10.10));
+ print (($port == 100) ? "ok 12\n" : "not ok 12\n");
+ print (($addr eq v10.10.10.10) ? "ok 13\n" : "not ok 13\n");
+}
+