~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to ansi-tests/make-instances-obsolete.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;-*- Mode:     Lisp -*-
 
2
;;;; Author:   Paul Dietz
 
3
;;;; Created:  Sat May 17 08:12:35 2003
 
4
;;;; Contains: Tests of MAKE-INSTANCES-OBSOLETE
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(defclass make-instances-obsolete-class-01 ()
 
9
  ((a :initarg :a)
 
10
   (b :initarg :b :allocation :class)
 
11
   (c :initarg :c :initform 'abc)
 
12
   (d :initarg :d :type fixnum :initform 0)))
 
13
 
 
14
(deftest make-instances-obsolete.1
 
15
  (let* ((class (find-class 'make-instances-obsolete-class-01))
 
16
         (obj (make-instance class :a 'x :b 'y :c 'z :d 17)))
 
17
    (values
 
18
     (eqt (class-of obj) class)
 
19
     (map-slot-value obj '(a b c d))
 
20
     (eqt (make-instances-obsolete class) class)
 
21
     (map-slot-value obj '(a b c d))))
 
22
  t (x y z 17) t (x y z 17))
 
23
 
 
24
(deftest make-instances-obsolete.2
 
25
  (let* ((class-designator 'make-instances-obsolete-class-01)
 
26
         (class (find-class class-designator))
 
27
         (obj (make-instance class :a 'x :b 'y :c 'z :d 17)))
 
28
    (values
 
29
     (eqt (class-of obj) class)
 
30
     (map-slot-value obj '(a b c d))
 
31
     (eqt (make-instances-obsolete class-designator) class-designator)
 
32
     (map-slot-value obj '(a b c d))))
 
33
  t (x y z 17) t (x y z 17))
 
34
 
 
35
;;; Error cases
 
36
 
 
37
(deftest make-instances-obsolete.error.1
 
38
  (signals-error (make-instances-obsolete) program-error)
 
39
  t)
 
40
 
 
41
(deftest make-instances-obsolete.error.2
 
42
  (signals-error (make-instances-obsolete
 
43
                   (find-class 'make-instances-obsolete-class-01)
 
44
                   nil)
 
45
                 program-error)
 
46
  t)