;;;; 00-socket.test --- test socket functions -*- scheme -*-
;;;;
;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-;;;; 2011, 2012, 2013 Free Software Foundation, Inc.
+;;;; 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
\f
-;;;
-;;; htonl
-;;;
-
-(if (defined? 'htonl)
- (with-test-prefix "htonl"
-
- (pass-if "0" (eqv? 0 (htonl 0)))
-
- (pass-if-exception "-1" exception:out-of-range
- (htonl -1))
-
- ;; prior to guile 1.6.9 and 1.8.1, systems with 64-bit longs didn't detect
- ;; an overflow for values 2^32 <= x < 2^63
- (pass-if-exception "2^32" exception:out-of-range
- (htonl (ash 1 32)))
-
- (pass-if-exception "2^1024" exception:out-of-range
- (htonl (ash 1 1024)))))
-
-
;;;
;;; inet-ntop
;;;
(and (= (sockaddr:fam sa) AF_UNIX)
(string=? (sockaddr:path sa) "/tmp/unix-socket"))))))
-;;;
-;;; ntohl
-;;;
-
-(if (defined? 'ntohl)
- (with-test-prefix "ntohl"
-
- (pass-if "0" (eqv? 0 (ntohl 0)))
-
- (pass-if-exception "-1" exception:out-of-range
- (ntohl -1))
-
- ;; prior to guile 1.6.9 and 1.8.1, systems with 64-bit longs didn't detect
- ;; an overflow for values 2^32 <= x < 2^63
- (pass-if-exception "2^32" exception:out-of-range
- (ntohl (ash 1 32)))
-
- (pass-if-exception "2^1024" exception:out-of-range
- (ntohl (ash 1 1024)))))
-
-
\f
;;;
;;; AF_UNIX sockets and `make-socket-address'