X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-simple-streams%2Fsimple-stream-tests.lisp;h=2371fc8facc610537cbc72f798d8c5da4e5a99c7;hb=d8e0a653d6974279581a3d1a151bde02ea6023c9;hp=557fb631eef381753163b55d6d96f0e559870405;hpb=830db48da09c88c0e91b11e2991d21b2a1af2579;p=sbcl.git diff --git a/contrib/sb-simple-streams/simple-stream-tests.lisp b/contrib/sb-simple-streams/simple-stream-tests.lisp index 557fb63..2371fc8 100644 --- a/contrib/sb-simple-streams/simple-stream-tests.lisp +++ b/contrib/sb-simple-streams/simple-stream-tests.lisp @@ -124,7 +124,10 @@ (string= (prog1 (write-line "Got it!" s) (finish-output s)) (read-line s))) ;; Fail gracefully if echo isn't activated on the system - (sb-bsd-sockets::connection-refused-error () t)) + (sb-bsd-sockets::connection-refused-error () t) + ;; Timeout may occur on the restricted systems (e.g. FreeBSD + ;; with jail(8) or blackhole(4) is used). + (sb-bsd-sockets::operation-timeout-error () t)) t) (deftest write-read-large-sc-1 @@ -197,7 +200,10 @@ (string= (prog1 (write-line content s) (finish-output s)) (read-line s)))) ;; Fail gracefully if echo isn't activated on the system - (sb-bsd-sockets::connection-refused-error () t)) + (sb-bsd-sockets::connection-refused-error () t) + ;; Timeout may occur on the restricted systems (e.g. FreeBSD + ;; with jail(8) or blackhole(4) is used). + (sb-bsd-sockets::operation-timeout-error () t)) t) @@ -924,3 +930,22 @@ Nothing to see here, move along.") :external-format :utf-8) (char-code (read-char s)))) 196) + +;; launchpad bug #491087 + +(deftest lp491087 + (labels ((read-big-int (stream) + (let ((b (make-array 1 :element-type '(signed-byte 32) + :initial-element 0))) + (declare (dynamic-extent b)) + (sb-simple-streams::read-vector b stream + :endian-swap :network-order) + (aref b 0)))) + (with-open-file (stream "lp491087.txt" :class 'file-simple-stream) + (let* ((start (file-position stream)) + (integer (read-big-int stream)) + (end (file-position stream))) + (and (= start 0) + (= integer #x30313233) + (= end 4))))) + T)