From: Artur Bergman Date: Wed, 29 Aug 2001 10:28:14 +0000 (+0000) Subject: Added three tests to test inet_ntoa/inet_aton and *packaddr* X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e245830c55d8c69f997346368c4b1b24cd4995a4;p=p5sagit%2Fp5-mst-13.2.git Added three tests to test inet_ntoa/inet_aton and *packaddr* Trying to catch errors on HP-UX p4raw-id: //depot/perl@11786 --- diff --git a/ext/Socket/Socket.t b/ext/Socket/Socket.t index 481fd8f..ea3a4be 100755 --- a/ext/Socket/Socket.t +++ b/ext/Socket/Socket.t @@ -13,7 +13,7 @@ BEGIN { use Socket; -print "1..8\n"; +print "1..11\n"; if (socket(T,PF_INET,SOCK_STREAM,6)) { print "ok 1\n"; @@ -85,3 +85,14 @@ print ($w == 1 ? "not ok 7\n" : "ok 7\n") ; use warnings 'Socket' ; sockaddr_in(1,2,3,4,5,6) ; print ($w == 1 ? "ok 8\n" : "not ok 8\n") ; + +# Thest that whatever we give into pack/unpack_sockaddr retains +# the value thru the entire chain. +if((inet_ntoa((unpack_sockaddr_in(pack_sockaddr_in(100,inet_aton("10.250.230.10"))))[1])) eq '10.250.230.10') { + print "ok 9\n"; +} 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_ntoa(v10.10.10.10) eq '10.10.10.10') ? "ok 11\n" : "not ok 11\n"); +