source: trunk/tests/ansi-tests/defclass-errors.lsp @ 9045

Last change on this file since 9045 was 9045, checked in by gz, 12 years ago

Assorted cleanup:

In infrastructure:

  • add *test-verbose* and :verbose argument to do-test and do-tests. Avoid random output if false, only show failures
  • muffle-wawrnings and/or bind *suppress-compiler-warnings* in some tests that unavoidably generate them (mainly with duplicate typecase/case clauses)
  • Add record-source-file for tests so meta-. can find them
  • If *catch-errors* (or the :catch-errors arg) is :break, enter a breakloop when catch an error
  • Make test fns created by *compile-tests* have names, so can find them in backtraces
  • fix misc compiler warnings
  • Fixed cases of duplicate test numbers
  • Disable note :make-condition-with-compound-name for openmcl.

In tests themselves:

I commented out the following tests with #+bogus-test, because they just seemed wrong to me:

lambda.47
lambda.50
upgraded-array-element-type.8
upgraded-array-element-type.nil.1
pathname-match-p.5
load.17
load.18
macrolet.47
ctypecase.15

In addition, I commented out the following tests with #+bogus-test because I was too lazy to make a note
for "doesn't signal underflow":

exp.error.8 exp.error.9 exp.error.10 exp.error.11 expt.error.8 expt.error.9 expt.error.10 expt.error.11

Finally, I entered bug reports in trac, and then commented out the tests
below with #+known-bug-NNN, where nnn is the ticket number in trac:

ticket#268: encode-universal-time.3 encode-universal-time.3.1
ticket#269: macrolet.36
ticket#270: values.20 values.21
ticket#271: defclass.error.13 defclass.error.22
ticket#272: phase.10 phase.12 asin.5 asin.6 asin.8
ticket#273: phase.18 phase.19 acos.8
ticket#274: exp.error.4 exp.error.5 exp.error.6 exp.error.7
ticket#275: car.error.2 cdr.error.2
ticket#276: map.error.11
ticket#277: subtypep.cons.43
ticket#278: subtypep-function.3
ticket#279: subtypep-complex.8
ticket#280: open.output.19 open.io.19 file-position.8 file-length.4 file-length.5 read-byte.4 stream-element-type.2 stream-element-type.3
ticket#281: open.65
ticket#288: set-syntax-from-char.sharp.1

File size: 4.0 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Fri Apr 25 06:59:22 2003
4;;;; Contains: Error case tests for DEFCLASS
5
6(in-package :cl-test)
7
8;;; I created some redundant tests by accident.  This list of
9;;; tests could be reduced in size.
10
11(deftest defclass.error.1
12  (signals-error
13   (defclass erroneous-class.1 ()
14     (a b c d b e))
15   program-error)
16  t)
17
18(deftest defclass.error.2
19  (signals-error
20   (defclass erroneous-class.2 ()
21     ((s1 :initarg :foo))
22     (:default-initargs :foo 1 :foo 2))
23   program-error)
24  t)
25
26(deftest defclass.error.3
27  (signals-error
28   (defclass erroneous-class.3 ()
29     ((s1 :initform 0 :initform 2)))
30   program-error)
31  t)
32
33(deftest defclass.error.4
34  (signals-error
35   (defclass erroneous-class.4 ()
36     ((s1 :initform 0 :initform 0)))
37   program-error)
38  t)
39
40(deftest defclass.error.5
41  (signals-error
42   (defclass erroneous-class.5 ()
43     ((s1 :type fixnum :type character)))
44   program-error)
45  t)
46
47(deftest defclass.error.6
48  (signals-error
49   (defclass erroneous-class.6 ()
50     ((s1 :type t :type t)))
51   program-error)
52  t)
53
54(deftest defclass.error.7
55  (signals-error
56   (defclass erroneous-class.7 ()
57     ((s1 :documentation "foo" :documentation "bar")))
58   program-error)
59  t)
60
61(deftest defclass.error.8
62  (signals-error
63   (defclass erroneous-class.8 ()
64     ((s1 :documentation #1="foo" :documentation #1#)))
65   program-error)
66  t)
67
68(deftest defclass.error.9
69  (signals-error
70   (defclass erroneous-class.9 ()
71     ((s1 :allocation :class :allocation :instance)))
72   program-error)
73  t)
74
75(deftest defclass.error.10
76  (signals-error
77   (defclass erroneous-class.10 ()
78     ((s1 :allocation :class :allocation :class)))
79   program-error)
80  t)
81
82(deftest defclass.error.11
83  (signals-error
84   (defclass erroneous-class.11 ()
85     ((s1 :allocation :instance :allocation :instance)))
86   program-error)
87  t)
88
89(deftest defclass.error.12
90  (signals-error
91   (defclass erroneous-class.12 ()
92     ((s1 #.(gensym) nil)))
93   program-error)
94  t)
95
96#+known-bug-271
97(deftest defclass.error.13
98  (signals-error
99   (defclass erroneous-class.13 ()
100     (a b c)
101     (#.(gensym)))
102   program-error)
103  t)
104
105(deftest defclass.error.14
106  (signals-error
107   (defclass defclass-error-14 nil
108     (foo foo))
109   program-error)
110  t)
111
112(deftest defclass.error.15
113  (signals-error
114   (defclass defclass-error-15 nil
115     (foo (foo)))
116   program-error)
117  t)
118
119(deftest defclass.error.16
120  (signals-error
121   (defclass defclass-error-16 nil
122     ((foo :initarg f1))
123     (:default-initargs :f1 10 :f1 20))
124   program-error)
125  t)
126
127(deftest defclass.error.17
128  (signals-error
129   (defclass defclass-error-17 nil
130     ((foo :initform 10 :initform 20 :reader defclass-error-4/foo)))
131   program-error)
132  t)
133
134(deftest defclass.error.18
135  (signals-error
136   (defclass defclass-error-18 nil
137     ((foo :initform 10 :initform 10 :reader defclass-error-5/foo)))
138   program-error)
139  t)
140
141(deftest defclass.error.19
142  (signals-error
143   (defclass defclass-error-19 nil
144     ((foo :initarg f1 :type t :type t :reader defclass-error-6/foo)))
145   program-error)
146  t)
147
148(deftest defclass.error.20
149  (signals-error
150   (defclass defclass-error-20 nil
151     ((foo :initarg f1 :documentation "x" :reader defclass-error-7/foo
152           :documentation "x")))
153   program-error)
154  t)
155
156(deftest defclass.error.21
157  (signals-error
158   (defclass defclass-error-21 ()
159     ((foo #:unknown-slot-option nil)))
160   program-error)
161  t)
162
163#+known-bug-271
164(deftest defclass.error.22
165  (let ((option (gentemp "UNKNOWN-OPTION" (symbol-package :foo))))
166    (eval
167     `(signals-error
168       (defclass defclass-error-22 ()
169         (foo bar)
170         (,option nil))
171       program-error)))
172  t)
173
174(deftest defclass.error.23
175  (loop for cl in *built-in-classes*
176        for name = (class-name cl)
177        unless (or (not name)
178                   (handler-case
179                    (progn (eval `(defclass ,(gensym) (,name))) nil)
180                    (error (c) c)))
181        collect (list cl name))
182  nil)
183
184(deftest defclass.error.24
185  (loop for cl in *built-in-classes*
186        for name = (class-name cl)
187        unless (or (not name)
188                   (handler-case
189                    (progn (eval `(defclass ,name ())) nil)
190                    (error (c) c)))
191        collect (list cl name))
192  nil)
193
Note: See TracBrowser for help on using the repository browser.