X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Falien.impure.lisp;h=e215ad248069f7f2d56686b27e4a77ce9ea63d1f;hb=5e92e9ed61903658015c2a75c79a32ad41dbd29d;hp=8984f7dc1c36f409a2563273aff1fcf3b2f8b5f0;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index 8984f7d..e215ad2 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -115,6 +115,17 @@ (deref integer-array 1))) (assert (eql (deref enum-array 2) 'k-two)))) +;; enums used to allow values to be used only once +;; C enums allow for multiple tags to point to the same value +(define-alien-type enum.4 + (enum nil (:key1 1) (:key2 2) (:keytwo 2))) +(with-alien ((enum-array (array enum.4 3))) + (setf (deref enum-array 0) :key1) + (setf (deref enum-array 1) :key2) + (setf (deref enum-array 2) :keytwo) + (assert (and (eql (deref enum-array 1) (deref enum-array 2)) + (eql (deref enum-array 1) :key2)))) + ;;; As reported by Baughn on #lisp, ALIEN-FUNCALL loops forever when ;;; compiled with (DEBUG 3). (sb-kernel::values-specifier-type-cache-clear) @@ -126,4 +137,3 @@ (assert (typep (funcall f "HOME") '(or string null)))) ;;; success -(quit :unix-status 104)