Unverified Commit 74b2820d authored by Karsten Poeck's avatar Karsten Poeck Committed by GitHub
Browse files

Fix sbcl, ecl & clasp on macosx (#65)

parent f9b1e368
......@@ -174,7 +174,9 @@
(map-errno-error (sb-bsd-sockets::socket-error-errno sock-err)))
(defparameter +sbcl-condition-map+
'((interrupted-error . interrupted-condition)))
'((interrupted-error . interrupted-condition)
#+(or ecl clasp)
(sb-bsd-sockets::host-not-found-error . ns-host-not-found-error)))
(defparameter +sbcl-error-map+
`((sb-bsd-sockets:address-in-use-error . address-in-use-error)
......
......@@ -61,7 +61,9 @@ been implemented yet."))
(:documentation "Parent condition for all name resolution conditions."))
(define-condition ns-error (ns-condition error)
()
(#+(or clasp ecl)
(socket :initarg :socket
:accessor usocket-socket))
(:documentation "Parent error for all name resolution errors."))
(eval-when (:compile-toplevel :load-toplevel :execute)
......@@ -197,7 +199,7 @@ error available."))
((55 105) . no-buffers-error)
((12) . out-of-memory-error)
((45 95) . operation-not-supported-error)
((1) . operation-not-permitted-error)
((1 13) . operation-not-permitted-error)
((43 92) . protocol-not-supported-error)
((44 93) . socket-type-not-supported-error)
((51 101) . network-unreachable-error)
......
......@@ -9,6 +9,10 @@
t)
nil)
;;; This test does not work, if timeout is ignored by the implementation
;;; Will get a connection-refused-error instead
#-(or ecl clasp)
(deftest timeout-error.1
(with-caught-conditions (usocket:timeout-error nil)
(usocket:socket-connect "common-lisp.net" 81 :timeout 0)
......@@ -23,6 +27,6 @@
(deftest operation-not-permitted-error.1
(with-caught-conditions (usocket:operation-not-permitted-error nil)
(usocket:socket-listen "0.0.0.0" 81)
(usocket:socket-listen "127.0.0.1" 81)
t)
nil)
......@@ -5,7 +5,9 @@
(in-package :usocket-test)
(defparameter +non-existing-host+ "1.2.3.4")
(defparameter +non-existing-host+ "1.2.3.4"
"The stringified IP address of a host on the same subnet. No physical host may be present.")
(defparameter +unused-local-port+ 15213)
(defparameter *fake-usocket*
......@@ -72,7 +74,7 @@
nil)
(deftest socket-failure.1
(with-caught-conditions (timeout-error nil)
(with-caught-conditions (#+(or :darwin :os-macosx) connection-refused-error #-(or :darwin :os-macosx) timeout-error nil)
(socket-connect 2130706433 +unused-local-port+ :timeout 1) ;; == #(127 0 0 1)
:unreach)
nil)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment