X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fmop.impure.lisp;h=ddc2e9b05afe40ddb3cd7500cfd0d1eac8e95ab1;hb=f4e8bca5eaa6e6db42299fe2f3852fb2e07508c7;hp=648b43bb85de39dc8282f2986c6e988c17599112;hpb=e86c7368eb115287ec44672390f790d54b5df940;p=sbcl.git diff --git a/tests/mop.impure.lisp b/tests/mop.impure.lisp index 648b43b..ddc2e9b 100644 --- a/tests/mop.impure.lisp +++ b/tests/mop.impure.lisp @@ -330,6 +330,45 @@ (let ((inst (make-instance 'testclass15 :x 12))) (assert (equal (list (testclass15-x inst) (setf (testclass15-y inst) 13)) '(12 13)))) + +;;; bug reported by Bruno Haible on sbcl-devel 2004-11-17: incorrect +;;; handling of multiple values for non-standard slot-options +(progn + (defclass option-slot-definition (sb-mop:standard-direct-slot-definition) + ((option :accessor sl-option :initarg :my-option))) + (defclass option-slot-class (standard-class) + ()) + (defmethod sb-mop:direct-slot-definition-class + ((c option-slot-class) &rest args) + (declare (ignore args)) + (find-class 'option-slot-definition)) + (defmethod sb-mop:validate-superclass + ((c1 option-slot-class) (c2 standard-class)) + t) + (eval '(defclass test-multiple-slot-option-bug () + ((x :my-option bar :my-option baz)) + (:metaclass option-slot-class))) + (assert (null (set-difference + '(bar baz) + (sl-option (first (sb-mop:class-direct-slots + (find-class 'test-multiple-slot-option-bug)))))))) + +;;; bug reported by Bruno Haibel on sbcl-devel 2004-11-19: AMOP requires +;;; that CLASS-PROTOYPE signals an error if the class is not yet finalized +(defclass prototype-not-finalized-sub (prototype-not-finalized-super) ()) +(multiple-value-bind (val err) + (ignore-errors (sb-mop:class-prototype (find-class 'prototype-not-finalized-super))) + (assert (null val)) + (assert (typep err 'error))) + +;;; AMOP says so +(find-method (fdefinition 'sb-mop:allocate-instance) () '(built-in-class)) +(dolist (class-name '(fixnum bignum symbol)) + (let ((class (find-class class-name))) + (multiple-value-bind (value error) (ignore-errors (allocate-instance class)) + (assert (null value)) + (assert (typep error 'error))))) + ;;;; success (sb-ext:quit :unix-status 104)