From: Artur Bergman Date: Wed, 29 Aug 2001 10:42:54 +0000 (+0000) Subject: Added test for pack_addr_in and unpack_addr_in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d09712d887062ccb5a1104006dc798bcb5502153;p=p5sagit%2Fp5-mst-13.2.git Added test for pack_addr_in and unpack_addr_in Nitpik in test 10 p4raw-id: //depot/perl@11787 --- diff --git a/ext/Socket/Socket.t b/ext/Socket/Socket.t index ea3a4be..20a57a4 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"); +} +