1 ;;;; miscellaneous side-effectful tests of the MOP
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 ;;; this file tests that FINALIZE-INHERITANCE behaves intuitively:
15 ;;; that when FINALIZE-INHERITANCE is called on a class, it returns
16 ;;; before subclasses are finalized.
23 (defclass mop-15-class
(standard-class) ())
25 (defmethod validate-superclass ((s mop-15-class
) (super standard-class
))
29 (defvar *max-count
* 0)
31 (defmethod finalize-inheritance ((c mop-15-class
))
32 (let ((*count
* (1+ *count
*)))
33 (when (> *count
* *max-count
*)
34 (setf *max-count
* *count
*))
39 (:metaclass mop-15-class
))
43 (:metaclass mop-15-class
))
45 (finalize-inheritance (find-class 'super
))
46 (finalize-inheritance (find-class 'sub
))
48 (assert (= *max-count
* 1))