X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Falien.impure.lisp;fp=tests%2Falien.impure.lisp;h=98e88f24fb30a534d67b94392e2a4fb271dbb293;hb=c58759647c8fc28996c6d519f2a38497c7edb704;hp=aa6eee6aba323dabdaf229d1cc4e850deb0cfdf3;hpb=33c86f6bca21d79cacc4efe98fd4ac425e1186ab;p=sbcl.git diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index aa6eee6..98e88f2 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -348,7 +348,13 @@ (assert (eq :multibyte-4 (handler-case - (let ((c-string (coerce #(70 111 246 0) + ;; KLUDGE, sort of. + ;; + ;; C-STRING decoding doesn't know how long the string is, and since this + ;; looks like a 4-byte sequence, it will grab 4 octets off the end. + ;; + ;; So we pad the vector for safety's sake. + (let ((c-string (coerce #(70 111 246 0 0 0) '(vector (unsigned-byte 8))))) (sb-sys:with-pinned-objects (c-string) (sb-alien::c-string-to-string (sb-sys:vector-sap c-string)