X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=3dc1d93c5a52f7768f2a0dff7cfe07a903e7e4b3;hb=5d5894082c39ca44da75d38859d669c7b2108f6a;hp=e923afcd7cc93844b91340a051e39b0f3eb9847e;hpb=157e21959c8023f146d6b03206aea6daa60e7b0d;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index e923afc..3dc1d93 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1344,7 +1344,7 @@ (defclass class-with-odd-class-name-method () ((a :accessor class-name))) -;;; another case where precomputing (this time on PRINT-OBJET) and +;;; another case where precomputing (this time on PRINT-OBJECT) and ;;; lazily-finalized classes caused problems. (report from James Y ;;; Knight sbcl-devel 20-07-2006) @@ -1591,5 +1591,33 @@ (assert (eql 13 (setf (slot-value 123 *magic-symbol*) 13))) (assert (eql 13 (slot-value 'foobar *magic-symbol*))) +;;;; Built-in structure and condition layouts should have NIL in +;;;; LAYOUT-FOR-STD-CLASS-P, and classes should have T. + +(assert (not (sb-pcl::layout-for-std-class-p (sb-pcl::find-layout 'warning)))) +(assert (not (sb-pcl::layout-for-std-class-p (sb-pcl::find-layout 'hash-table)))) +(assert (eq t (sb-pcl::layout-for-std-class-p (sb-pcl::find-layout 'standard-object)))) + +;;;; bug 402: PCL used to warn about non-standard declarations +(declaim (declaration bug-402-d)) +(defgeneric bug-402-gf (x)) +(with-test (:name :bug-402) + (handler-bind ((warning #'error)) + (eval '(defmethod bug-402-gf (x) + (declare (bug-402-d x)) + x)))) + +;;;; non-keyword :default-initargs + :before method on shared initialize +;;;; interacted badly with CTOR optimizations +(defclass ctor-default-initarg-problem () + ((slot :initarg slotto)) + (:default-initargs slotto 123)) +(defmethod shared-initialize :before ((instance ctor-default-initarg-problem) slot-names &rest initargs) + (format t "~&Rock on: ~A~%" initargs)) +(defun provoke-ctor-default-initarg-problem () + (make-instance 'ctor-default-initarg-problem)) +(handler-bind ((warning #'error)) + (assert (= 123 (slot-value (provoke-ctor-default-initarg-problem) 'slot)))) + ;;;; success