anchor.diff:                     (return :bad)))
               finally (return :ok)))))
   
  +(defun read-vector-test (reader bitsize signedp big-endian-p)
  +  (let* ((pathname *path*)
  +	 (file-contents (subseq (read-file-as-octets pathname) 0 8))
  +	 (expected-values (generate-reffed-values file-contents bitsize
  +						  signedp big-endian-p nil)))
  +    (with-open-file (stream pathname :direction :input
  +			    :element-type '(unsigned-byte 8))
  +      (let* ((n-values (truncate (length file-contents)
  +				 (truncate bitsize 8)))
  +	     (read-values (funcall reader stream n-values)))
  +	(if (mismatch read-values expected-values)
  +	    :bad
  +	    :ok)))))
  +
   (rtest:deftest :read-ub16/be
     (read-test 'nibbles:read-ub16/be 16 nil t)
     :ok)
  
positive.code:         do (setf (aref v i) (random 256))
          finally (return v)))
  
  (defun generate-reffed-values (byte-vector bitsize signedp big-endian-p)
    (do* ((byte-kind (if signedp 'signed-byte 'unsigned-byte))
          (bytesize (truncate bitsize 8))
          (n-values (- (length byte-vector) (1- bytesize)))
          (ev (make-array n-values
                          :element-type `(,byte-kind ,bitsize)))
          (i 0 (1+ i))
          (j 0)
          (combiner (make-byte-combiner bytesize big-endian-p)))
        ((>= i (length byte-vector)) ev)
      (multiple-value-bind (aggregate set-p) (funcall combiner (aref byte-vector i))
        (when set-p
          (setf (aref ev j)
                (if (and signedp (logbitp (1- bitsize) aggregate))
                    (dpb aggregate (byte bitsize 0) -1)
                    aggregate))
          (incf j)))))
  
  (defvar *default-n-values* 4096)
  
negative.code: 
  (rtest:deftest :read-sb64/le
    (read-test 'nibbles:read-sb64/le 64 t nil)
    :ok)
  
  (rtest:deftest :read-ub16/be-vector
    (read-vector-test 'nibbles:read-ub16/be-vector 16 nil t)
    :ok)
  
  (rtest:deftest :read-sb16/be-vector
    (read-vector-test 'nibbles:read-sb16/be-vector 16 t t)
    :ok)
  
  (rtest:deftest :read-ub32/be-vector
    (read-vector-test 'nibbles:read-ub32/be-vector 32 nil t)
    :ok)
  
  (rtest:deftest :read-sb32/be-vector
    (read-vector-test 'nibbles:read-sb32/be-vector 32 t t)
    :ok)
  
  (rtest:deftest :read-ub64/be-vector
    (read-vector-test 'nibbles:read-ub64/be-vector 64 nil t)
    :ok)
  
  (rtest:deftest :read-sb64/be-vector
    (read-vector-test 'nibbles:read-sb64/be-vector 64 t t)
    :ok)
  
  (rtest:deftest :read-ub16/le-vector
    (read-vector-test 'nibbles:read-ub16/le-vector 16 nil nil)
    :ok)
  
  (rtest:deftest :read-sb16/le-vector
    (read-vector-test 'nibbles:read-sb16/le-vector 16 t nil)
    :ok)
  
  (rtest:deftest :read-ub32/le-vector
    (read-vector-test 'nibbles:read-ub32/le-vector 32 nil nil)
    :ok)
  
  (rtest:deftest :read-sb32/le-vector
    (read-vector-test 'nibbles:read-sb32/le-vector 32 t nil)
    :ok)
  
  (rtest:deftest :read-ub64/le-vector
    (read-vector-test 'nibbles:read-ub64/le-vector 64 nil nil)
    :ok)
  
  (rtest:deftest :read-sb64/le-vector
    (read-vector-test 'nibbles:read-sb64/le-vector 64 t nil)
    :ok)
  
  