Commit 1d84bb97 authored by pfdietz's avatar pfdietz

Fixed open stream problem in read-sequence tests

parent 19064914
...@@ -188,18 +188,25 @@ ...@@ -188,18 +188,25 @@
(defmacro def-read-sequence-bv-test (name init args &rest expected) (defmacro def-read-sequence-bv-test (name init args &rest expected)
`(deftest ,name `(deftest ,name
;; Create output file ;; Create output file
(let ((os (open "temp.dat" :direction :output (progn
:element-type '(unsigned-byte 8) (let (os)
:if-exists :supersede))) (unwind-protect
(loop for i in '(0 1 1 0 0 1 1 0 1 0 1 1 1 0) (progn
do (write-byte i os)) (setq os (open "temp.dat" :direction :output
(close os) :element-type '(unsigned-byte 8)
(let ((is (open "temp.dat" :direction :input :if-exists :supersede))
:element-type '(unsigned-byte 8))) (loop for i in '(0 1 1 0 0 1 1 0 1 0 1 1 1 0)
(bv (copy-seq ,init))) do (write-byte i os)))
(values (when os (close os))))
(read-sequence bv is ,@args) (let (is (bv (copy-seq ,init)))
bv))) (unwind-protect
(progn
(setq is (open "temp.dat" :direction :input
:element-type '(unsigned-byte 8)))
(values
(read-sequence bv is ,@args)
bv))
(when is (close is)))))
,@expected)) ,@expected))
(def-read-sequence-bv-test read-sequence.bv.1 #*00000000000000 () (def-read-sequence-bv-test read-sequence.bv.1 #*00000000000000 ()
......
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