X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fbit-vector.impure-cload.lisp;h=65f075adb361c4291fedcd41d3554449dbc7ddfd;hb=31f68584d0732dc0d17f379773e5f87f1e5a78ad;hp=470bf570a9b926412388349a75524743754417d2;hpb=175c318c892b0627b36fa3c4db66f59680242204;p=sbcl.git diff --git a/tests/bit-vector.impure-cload.lisp b/tests/bit-vector.impure-cload.lisp index 470bf57..65f075a 100644 --- a/tests/bit-vector.impure-cload.lisp +++ b/tests/bit-vector.impure-cload.lisp @@ -69,18 +69,41 @@ (assert (= (aref a 0) 1)) (inform :aref-2) (assert (= (aref a (- array-dimension-limit 2)) 1)) - #-darwin - (progn - (inform :bit-and) - (bit-and a b a) - (inform :aref-3) - (assert (= (aref a 0) 0)) - (inform :aref-4) - (assert (= (aref a (- array-dimension-limit 2)) 0))))) + (inform :bit-and) + (bit-and a b a) + (inform :aref-3) + (assert (= (aref a 0) 0)) + (inform :aref-4) + (assert (= (aref a (- array-dimension-limit 2)) 0)))) (test-small-bit-vectors) -#-x86-64 -;; except on machines where addressable space is likely to be -;; much bigger than physical memory +;; except on machines where the arrays won't fit into the dynamic space. +#+#.(cl:if (cl:> (sb-ext:dynamic-space-size) + (cl:truncate (cl:1- cl:array-dimension-limit) + sb-vm:n-word-bits)) + '(and) + '(or)) (test-big-bit-vectors) + +(with-test (:name :find-non-bit-from-bit-vector) + (assert (not (find #\a #*0101))) + (assert (not (position #\a #*0101))) + (let ((f1 (compile nil + `(lambda (b) + (find b #*0101)))) + (f2 (compile nil + `(lambda (b) + (position b #*0101))))) + (assert (not (funcall f1 t))) + (assert (not (funcall f2 t)))) + (let ((f1 (compile nil + `(lambda (b) + (declare (bit-vector b)) + (find t b)))) + (f2 (compile nil + `(lambda (b) + (declare (bit-vector b)) + (position t b))))) + (assert (not (funcall f1 #*010101))) + (assert (not (funcall f2 #*101010)))))