anchor.diff:                 (setf buffer val))))
             (t (values 0 nil))))))
   
  -(defun generate-random-test (ref-size signedp &optional (n-octets 4096))
  +(defun generate-random-test (ref-size signedp big-endian-p
  +                             &optional (n-octets 4096))
     (do* ((byte-kind (if signedp 'signed-byte 'unsigned-byte))
           (n-bits (* 8 ref-size))
           (total-octets (+ n-octets (1- ref-size)))
  
positive.code: 
  ;;; Basic tests for correctness.
  
  (defun make-byte-combiner (n-bytes)
    (let ((count 0)
          (buffer 0))
      #'(lambda (byte)
          (setf buffer (logior (ash buffer 8) byte))
          (unless (= count n-bytes)
            (incf count))
          (cond
  
negative.code: ;;; Big-endian integer ref tests
  
  (rtest:deftest :ub16ref/be
    (ref-test #'nibbles:ub16ref/be 2 nil t)
    :ok)
  
  (rtest:deftest :sb16ref/be
    (ref-test #'nibbles:sb16ref/be 2 t t)
    :ok)
  
  (rtest:deftest :ub32ref/be
    (ref-test #'nibbles:ub32ref/be 4 nil t)
    :ok)
  
  (rtest:deftest :sb32ref/be
    (ref-test #'nibbles:sb32ref/be 4 t t)
    :ok)
  
  (rtest:deftest :ub64ref/be
    (ref-test #'nibbles:ub64ref/be 8 nil t)
    :ok)
  
  (rtest:deftest :sb64ref/be
    (ref-test #'nibbles:sb64ref/be 8 t t)
    :ok)
  
  