Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv10966/tests
Modified Files:
clocc-ansi-test-known-bugs.lisp clos.impure.lisp
Log Message:
0.7.10.36:
Clean up regressions, easy new bugs, etc.
... fix one or two embarrassing bugs in ctor MAKE-INSTANCE optimization
patch:
* REINITIALIZE-INSTANCE now checks arguments again
* defining methods on MAKE-INSTANCE (or its siblings) now
invalidates the optimized methods for subclasses too
... trivial ADJUST-ARRAY patch
Index: clocc-ansi-test-known-bugs.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/clocc-ansi-test-known-bugs.lisp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- clocc-ansi-test-known-bugs.lisp 28 Dec 2002 20:52:48 -0000 1.6
+++ clocc-ansi-test-known-bugs.lisp 30 Dec 2002 00:42:27 -0000 1.7
@@ -137,7 +137,6 @@
:EXCEPSIT-LEGACY-1201
:EXCEPSIT-LEGACY-1269
:EXCEPSIT-LEGACY-1273
- :EXCEPSIT-LEGACY-1277
:EXCEPSIT-LEGACY-1327
:EXCEPSIT-LEGACY-1357
:EXCEPSIT-LEGACY-1369
Index: clos.impure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/clos.impure.lisp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- clos.impure.lisp 16 Dec 2002 16:24:02 -0000 1.27
+++ clos.impure.lisp 30 Dec 2002 00:42:27 -0000 1.28
@@ -11,9 +11,11 @@
;;;; absolutely no warranty. See the COPYING and CREDITS files for
;;;; more information.
-(defpackage "FOO"
- (:use "CL"))
-(in-package "FOO")
+(load "assertoid.lisp")
+
+(defpackage "CLOS-IMPURE"
+ (:use "CL" "ASSERTOID"))
+(in-package "CLOS-IMPURE")
;;; It should be possible to do DEFGENERIC and DEFMETHOD referring to
;;; structure types defined earlier in the file.
@@ -517,6 +519,39 @@
(assert (= (bug222-b t x) 3))
;; specified.
(assert (char= (char (get-output-stream-string x) 0) #\1)))
+
+;;; REINITIALIZE-INSTANCE, in the ctor optimization, wasn't checking
+;;; for invalid initargs where it should:
+(defclass class234 () ())
+(defclass subclass234 (class234) ())
+(defvar *bug234* 0)
+(defun bug-234 ()
+ (reinitialize-instance (make-instance 'class234) :dummy 0))
+(defun subbug-234 ()
+ (reinitialize-instance (make-instance 'subclass234) :dummy 0))
+(assert (raises-error? (bug-234) program-error))
+(defmethod shared-initialize :after ((i class234) slots &key dummy)
+ (incf *bug234*))
+(assert (typep (subbug-234) 'subclass234))
+(assert (= *bug234*
+ ;; once for MAKE-INSTANCE, once for REINITIALIZE-INSTANCE
+ 2))
+
+;;; also, some combinations of MAKE-INSTANCE and subclassing missed
+;;; new methods (Gerd Moellmann sbcl-devel 2002-12-29):
+(defclass class234-b1 () ())
+(defclass class234-b2 (class234-b1) ())
+(defvar *bug234-b* 0)
+(defun bug234-b ()
+ (make-instance 'class234-b2))
+(compile 'bug234-b)
+(bug234-b)
+(assert (= *bug234-b* 0))
+(defmethod initialize-instance :before ((x class234-b1) &rest args)
+ (declare (ignore args))
+ (incf *bug234-b*))
+(bug234-b)
+(assert (= *bug234-b* 1))
;;;; success
(sb-ext:quit :unix-status 104)
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|