Commit a909e274 authored by pfdietz's avatar pfdietz

Changed classify-error forms to signals-error forms.

parent d8f454a3
......@@ -145,7 +145,7 @@
(deftest macrolet.16
(loop for s in *cl-non-function-macro-special-operator-symbols*
for form = `(classify-error (macrolet ((,s () ''a)) (,s)))
for form = `(ignore-errors (macrolet ((,s () ''a)) (,s)))
unless (eq (eval form) 'a)
collect s)
nil)
......@@ -385,7 +385,7 @@
(deftest symbol-macrolet.1
(loop for s in *cl-non-variable-constant-symbols*
for form = `(classify-error (symbol-macrolet ((,s 17)) ,s))
for form = `(ignore-errors (symbol-macrolet ((,s 17)) ,s))
unless (eql (eval form) 17)
collect s)
nil)
......@@ -425,17 +425,20 @@
(deftest symbol-macrolet.error.1
(classify-error
(signals-error
(symbol-macrolet ((x 10))
(declare (special x))
20))
program-error)
20)
program-error)
t)
(deftest symbol-macrolet.error.2
(classify-error (symbol-macrolet ((t 'a)) t))
program-error)
(signals-error (symbol-macrolet ((t 'a)) t)
program-error)
t)
(deftest symbol-macrolet.error.3
(classify-error (symbol-macrolet ((*pathnames* 19)) *pathnames*))
program-error)
(signals-error (symbol-macrolet ((*pathnames* 19)) *pathnames*)
program-error)
t)
\ No newline at end of file
......@@ -619,29 +619,31 @@
;;; Error tests
(deftest make-array.error.1
(classify-error (make-array))
program-error)
(signals-error (make-array) program-error)
t)
(deftest make-array.error.2
(classify-error (make-array '(10) :bad t))
program-error)
(signals-error (make-array '(10) :bad t) program-error)
t)
(deftest make-array.error.3
(classify-error (make-array '(10) :allow-other-keys nil :bad t))
program-error)
(signals-error (make-array '(10) :allow-other-keys nil :bad t)
program-error)
t)
(deftest make-array.error.4
(classify-error (make-array '(10) :allow-other-keys nil
:allow-other-keys t :bad t))
program-error)
(signals-error (make-array '(10) :allow-other-keys nil
:allow-other-keys t :bad t)
program-error)
t)
(deftest make-array.error.5
(classify-error (make-array '(10) :bad))
program-error)
(signals-error (make-array '(10) :bad) program-error)
t)
(deftest make-array.error.6
(classify-error (make-array '(10) 1 2))
program-error)
(signals-error (make-array '(10) 1 2) program-error)
t)
;;; Order of evaluation tests
......
......@@ -8,15 +8,16 @@
;;; MAKE-INSTANCE is used in many other tests as well
(deftest make-instance.error.1
(classify-error (make-instance))
program-error)
(signals-error (make-instance) program-error)
t)
(defclass make-instance-class-01 ()
((a :initarg :a) (b :initarg :b)))
(deftest make-instance.error.2
(classify-error (make-instance 'make-instance-class-01 :a))
program-error)
(signals-error (make-instance 'make-instance-class-01 :a)
program-error)
t)
(deftest make-instance.error.3
(handler-case (progn (eval '(make-instance 'make-instance-class-01 :z 1))
......@@ -33,8 +34,9 @@
:good)
(deftest make-instance.error.5
(classify-error (let () (make-instance) nil))
program-error)
(signals-error (let () (make-instance) nil)
program-error)
t)
;; Definitions of methods
......
......@@ -34,11 +34,12 @@
;;; Error cases
(deftest make-instances-obsolete.error.1
(classify-error (make-instances-obsolete))
program-error)
(signals-error (make-instances-obsolete) program-error)
t)
(deftest make-instances-obsolete.error.2
(classify-error (make-instances-obsolete
(signals-error (make-instances-obsolete
(find-class 'make-instances-obsolete-class-01)
nil))
program-error)
nil)
program-error)
t)
......@@ -73,29 +73,30 @@
type-error)
(deftest make-list.error.2
(classify-error (make-list 'a))
type-error)
(signals-error (make-list 'a) type-error)
t)
(deftest make-list.error.3
(classify-error (make-list))
program-error)
(signals-error (make-list) program-error)
t)
(deftest make-list.error.4
(classify-error (make-list 5 :bad t))
program-error)
(signals-error (make-list 5 :bad t) program-error)
t)
(deftest make-list.error.5
(classify-error (make-list 5 :initial-element))
program-error)
(signals-error (make-list 5 :initial-element) program-error)
t)
(deftest make-list.error.6
(classify-error (make-list 5 1 2))
program-error)
(signals-error (make-list 5 1 2) program-error)
t)
(deftest make-list.error.7
(classify-error (make-list 5 :bad t :allow-other-keys nil))
program-error)
(signals-error (make-list 5 :bad t :allow-other-keys nil)
program-error)
t)
(deftest make-list.error.8
(classify-error (locally (make-list 'a) t))
type-error)
(signals-error (locally (make-list 'a) t) type-error)
t)
......@@ -179,15 +179,17 @@
;;; General error tests
(deftest make-load-form-saving-slots.error.1
(classify-error (make-load-form-saving-slots))
program-error)
(signals-error (make-load-form-saving-slots) program-error)
t)
(deftest make-load-form-saving-slots.error.2
(classify-error (make-load-form-saving-slots (make-instance 'mlfss-02)
:slot-names))
program-error)
(signals-error (make-load-form-saving-slots (make-instance 'mlfss-02)
:slot-names)
program-error)
t)
(deftest make-load-form-saving-slots.error.3
(classify-error (make-load-form-saving-slots (make-instance 'mlfss-02)
(gensym) t))
program-error)
(signals-error (make-load-form-saving-slots (make-instance 'mlfss-02)
(gensym) t)
program-error)
t)
......@@ -208,13 +208,12 @@
;;; Other error tests
(deftest make-load-form.error.1
(classify-error (make-load-form))
program-error)
(signals-error (make-load-form) program-error)
t)
(deftest make-load-form.error.2
(classify-error
(signals-error
(let ((obj (make-instance 'make-load-form-class-04 :b '(a b c) :c 'a)))
(make-load-form obj nil nil)))
program-error)
(make-load-form obj nil nil))
program-error)
t)
......@@ -117,30 +117,35 @@
;;; Various constraints on :directory
(deftest make-pathname-error-absolute-up
(classify-error (directory (make-pathname :directory '(:absolute :up))))
file-error)
(signals-error (directory (make-pathname :directory '(:absolute :up)))
file-error)
t)
(deftest make-pathname-error-absolute-back
(classify-error (directory (make-pathname :directory '(:absolute :back))))
file-error)
(signals-error (directory (make-pathname :directory '(:absolute :back)))
file-error)
t)
;; The next test is correct, but was causing very large amounts of time to be spent
;; in buggy implementations
#|
(deftest make-pathname-error-absolute-wild-inferiors-up
(classify-error (directory (make-pathname :directory '(:absolute :wild-inferiors :up))))
file-error)
(signals-error (directory (make-pathname :directory '(:absolute :wild-inferiors :up)))
file-error)
t)
|#
(deftest make-pathname-error-relative-wild-inferiors-up
(classify-error (length (directory (make-pathname :directory '(:relative :wild-inferiors :up)))))
file-error)
(signals-error (length (directory (make-pathname :directory '(:relative :wild-inferiors :up))))
file-error)
t)
(deftest make-pathname-error-absolute-wild-inferiors-back
(classify-error (directory (make-pathname :directory '(:absolute :wild-inferiors :back))))
file-error)
(signals-error (directory (make-pathname :directory '(:absolute :wild-inferiors :back)))
file-error)
t)
(deftest make-pathname-error-relative-wild-inferiors-back
(classify-error (directory (make-pathname :directory '(:relative :wild-inferiors :back))))
file-error)
(signals-error (directory (make-pathname :directory '(:relative :wild-inferiors :back)))
file-error)
t)
......@@ -5,26 +5,29 @@
(in-package :cl-test)
;;; Error tests
(deftest make-random-state.error.1
(classify-error (make-random-state nil nil))
program-error)
(signals-error (make-random-state nil nil) program-error)
t)
(deftest make-random-state.error.2
(classify-error (make-random-state t nil))
program-error)
(signals-error (make-random-state t nil) program-error)
t)
(deftest make-random-state.error.3
(classify-error (make-random-state *random-state* nil))
program-error)
(signals-error (make-random-state *random-state* nil) program-error)
t)
(deftest make-random-state.error.4
(loop for x in *mini-universe*
unless (or (null x) (eq x t) (random-state-p x)
(eq (eval `(classify-error (make-random-state ',x)))
'type-error))
(eval `(signals-error (make-random-state ',x) type-error)))
collect x)
nil)
;;; Non-error tests
(deftest make-random-state.1
(let ((rs (make-random-state)))
(and (not (eq rs *random-state*))
......
......@@ -207,60 +207,63 @@
;;; Tests for errors
(deftest make-sequence.error.1
(classify-error (make-sequence 'symbol 10))
type-error)
(signals-error (make-sequence 'symbol 10) type-error)
t)
(deftest make-sequence.error.2
(classify-error (make-sequence 'null 1))
type-error)
(signals-error (make-sequence 'null 1) type-error)
t)
(deftest make-sequence.error.3
(classify-error (make-sequence '(vector * 4) 3))
type-error)
(signals-error (make-sequence '(vector * 4) 3) type-error)
t)
(deftest make-sequence.error.4
(classify-error (make-sequence '(vector * 2) 3))
type-error)
(signals-error (make-sequence '(vector * 2) 3) type-error)
t)
(deftest make-sequence.error.5
(classify-error (make-sequence '(string 4) 3))
type-error)
(signals-error (make-sequence '(string 4) 3) type-error)
t)
(deftest make-sequence.error.6
(classify-error (make-sequence '(simple-string 2) 3))
type-error)
(signals-error (make-sequence '(simple-string 2) 3) type-error)
t)
(deftest make-sequence.error.7
(classify-error (make-sequence 'cons 0))
type-error)
(signals-error (make-sequence 'cons 0) type-error)
t)
(deftest make-sequence.error.8
(classify-error (make-sequence))
program-error)
(signals-error (make-sequence) program-error)
t)
(deftest make-sequence.error.9
(classify-error (make-sequence 'list))
program-error)
(signals-error (make-sequence 'list) program-error)
t)
(deftest make-sequence.error.10
(classify-error (make-sequence 'list 10 :bad t))
program-error)
(signals-error (make-sequence 'list 10 :bad t) program-error)
t)
(deftest make-sequence.error.11
(classify-error (make-sequence 'list 10 :bad t :allow-other-keys nil))
program-error)
(signals-error (make-sequence 'list 10 :bad t :allow-other-keys nil)
program-error)
t)
(deftest make-sequence.error.12
(classify-error (make-sequence 'list 10 :initial-element))
program-error)
(signals-error (make-sequence 'list 10 :initial-element)
program-error)
t)
(deftest make-sequence.error.13
(classify-error (make-sequence 'list 10 0 0))
program-error)
(signals-error (make-sequence 'list 10 0 0) program-error)
t)
(deftest make-sequence.error.14
(classify-error (locally (make-sequence 'symbol 10) t))
type-error)
(signals-error (locally (make-sequence 'symbol 10) t)
type-error)
t)
;;; Order of execution tests
......
......@@ -122,28 +122,29 @@
;; Error cases
(deftest make-string.error.1
(classify-error (make-string))
program-error)
(signals-error (make-string) program-error)
t)
(deftest make-string.error.2
(classify-error (make-string 10 :bad t))
program-error)
(signals-error (make-string 10 :bad t) program-error)
t)
(deftest make-string.error.3
(classify-error (make-string 10 :bad t :allow-other-keys nil))
program-error)
(signals-error (make-string 10 :bad t :allow-other-keys nil)
program-error)
t)
(deftest make-string.error.4
(classify-error (make-string 10 :initial-element))
program-error)
(signals-error (make-string 10 :initial-element) program-error)
t)
(deftest make-string.error.5
(classify-error (make-string 10 1 1))
program-error)
(signals-error (make-string 10 1 1) program-error)
t)
(deftest make-string.error.6
(classify-error (make-string 10 :element-type))
program-error)
(signals-error (make-string 10 :element-type) program-error)
t)
;;; Order of evaluation
......
......@@ -59,45 +59,45 @@
"ABC" 1)
(deftest make-symbol.error.1
(classify-error (make-symbol nil))
type-error)
(signals-error (make-symbol nil) type-error)
t)
(deftest make-symbol.error.2
(classify-error (make-symbol 'a))
type-error)
(signals-error (make-symbol 'a) type-error)
t)
(deftest make-symbol.error.3
(classify-error (make-symbol 1))
type-error)
(signals-error (make-symbol 1) type-error)
t)
(deftest make-symbol.error.4
(classify-error (make-symbol -1))
type-error)
(signals-error (make-symbol -1) type-error)
t)
(deftest make-symbol.error.5
(classify-error (make-symbol 1.213))
type-error)
(signals-error (make-symbol 1.213) type-error)
t)
(deftest make-symbol.error.6
(classify-error (make-symbol -1312.2))
type-error)
(signals-error (make-symbol -1312.2) type-error)
t)
(deftest make-symbol.error.7
(classify-error (make-symbol #\w))
type-error)
(signals-error (make-symbol #\w) type-error)
t)
(deftest make-symbol.error.8
(classify-error (make-symbol '(a)))
type-error)
(signals-error (make-symbol '(a)) type-error)
t)
(deftest make-symbol.error.9
(classify-error (make-symbol))
program-error)
(signals-error (make-symbol) program-error)
t)
(deftest make-symbol.error.10
(classify-error (make-symbol "a" "a"))
program-error)
(signals-error (make-symbol "a" "a") program-error)
t)
(deftest make-symbol.error.11
(classify-error (make-symbol '(#\a #\b #\c)))
type-error)
(signals-error (make-symbol '(#\a #\b #\c)) type-error)
t)
......@@ -348,42 +348,45 @@
;;; Error cases
(deftest map-into.error.1
(classify-error (map-into 'a #'(lambda () nil)))
type-error)
(signals-error (map-into 'a #'(lambda () nil)) type-error)
t)
;;; The next test was changed because if the first argument
;;; is NIL, map-into is said to 'return nil immediately', so
;;; the 'should be prepared' notation for the error checking
;;; means that error checking may be skipped.
(deftest map-into.error.2
(case (classify-error (map-into nil #'identity 'a))
((nil type-error) 'good)
(t 'bad))
good)
(and (locally (declare (safety 3))
(handler-case (eval '(map-into nil #'identity 'a))
(type-error () nil)))
:bad)
nil)
(deftest map-into.error.3
(classify-error (map-into (copy-seq '(a b c)) #'cons '(d e f) 100))
type-error)
(signals-error (map-into (copy-seq '(a b c)) #'cons '(d e f) 100)
type-error)
t)
(deftest map-into.error.4
(classify-error (map-into))
program-error)
(signals-error (map-into) program-error)
t)
(deftest map-into.error.5
(classify-error (map-into (list 'a 'b 'c)))
program-error)
(signals-error (map-into (list 'a 'b 'c)) program-error)
t)
(deftest map-into.error.6
(classify-error (locally (map-into 'a #'(lambda () nil)) t))
type-error)
(signals-error (locally (map-into 'a #'(lambda () nil)) t)
type-error)
t)
(deftest map-into.error.7
(classify-error (map-into (list 'a 'b 'c) #'cons '(a b c)))
program-error)
(signals-error (map-into (list 'a 'b 'c) #'cons '(a b c)) program-error)
t)
(deftest map-into.error.8
(classify-error (map-into (list 'a 'b 'c) #'car '(a b c)))
type-error)
(signals-error (map-into (list 'a 'b 'c) #'car '(a b c)) type-error)
t)
;;; Order of evaluation tests
......
......@@ -170,36 +170,37 @@
:caught)
(deftest map.error.2
(classify-error (map '(vector * 8) #'identity '(a b c)))
type-error)
(signals-error (map '(vector * 8) #'identity '(a b c)) type-error)
t)
(deftest map.error.3
(classify-error (map 'list #'identity '(a b . c)))
type-error)
(signals-error (map 'list #'identity '(a b . c)) type-error)
t)
(deftest map.error.4
(classify-error (map))
program-error)
(signals-error (map) program-error)
t)
(deftest map.error.5
(classify-error (map 'list))
program-error)
(signals-error (map 'list) program-error)
t)
(deftest map.error.6
(classify-error (map 'list #'null))
program-error)
(signals-error (map 'list #'null) program-error)
t)
(deftest map.error.7
(classify-error (map 'list #'cons '(a b c d)))
program-error)
(signals-error (map 'list #'cons '(a b c d)) program-error)
t)
(deftest map.error.8
(classify-error (map 'list #'cons '(a b c d) '(1 2 3 4) '(5 6 7 8)))
program-error)
(signals-error (map 'list #'cons '(a b c d) '(1 2 3 4) '(5 6 7 8))
program-error)
t)
(deftest map.error.9
(classify-error (map 'list #'car '(a b c d)))
type-error)
(signals-error (map 'list #'car '(a b c d)) type-error)
t)
;;; Test mapping on arrays with fill pointers
......
......@@ -72,33 +72,33 @@
(a b c) 3 1 2 3)
(deftest mapc.error.1
(classify-error (mapc #'identity 1))
type-error)
(signals-error (mapc #'identity 1) type-error)
t)
(deftest mapc.error.2
(classify-error (mapc))
program-error)
(signals-error (mapc) program-error)
t)
(deftest mapc.error.3
(classify-error (mapc #'append))
program-error)
(signals-error (mapc #'append) program-error)
t)
(deftest mapc.error.4
(classify-error (locally (mapc #'identity 1) t))
type-error)
(signals-error (locally (mapc #'identity 1) t) type-error)
t)
(deftest mapc.error.5
(classify-error (mapc #'cons '(a b c)))
program-error)
(signals-error (mapc #'cons '(a b c)) program-error)
t)
(deftest mapc.error.6
(classify-error (mapc #'cons '(a b c) '(1 2 3) '(4 5 6)))
program-error)
(signals-error (mapc #'cons '(a b c) '(1 2 3) '(4 5 6)) program-error)
t)
(deftest mapc.error.7
(classify-error (mapc #'car '(a b c)))
type-error)
(signals-error (mapc #'car '(a b c)) type-error)
t)
(deftest mapc.error.8
(classify-error (mapc #'identity (list* 1 2 3 4)))
type-error)
(signals-error (mapc #'identity (list* 1 2 3 4)) type-error)
t)
......@@ -86,33 +86,35 @@
1)
(deftest mapcan.error.1
(classify-error (mapcan #'identity 1))
type-error)
(signals-error (mapcan #'identity 1) type-error)
t)
(deftest mapcan.error.2
(classify-error (mapcan))
program-error)
(signals-error (mapcan) program-error)
t)
(deftest mapcan.error.3
(classify-error (mapcan #'append))
program-error)
(signals-error (mapcan #'append) program-error)
t)
(deftest mapcan.error.4
(classify-error (locally (mapcan #'identity 1) t))
type-error)
(signals-error (locally (mapcan #'identity 1) t) type-error)
t)
(deftest mapcan.error.5
(classify-error (mapcan #'car '(a b c)))
type-error)
(signals-error (mapcan #'car '(a b c)) type-error)
t)
(deftest mapcan.error.6
(classify-error (mapcan #'cons '(a b c)))
program-error)
(signals-error (mapcan #'cons '(a b c)) program-error)
t)
(deftest mapcan.error.7
(classify-error (mapcan #'cons '(a b c) '(1 2 3) '(4 5 6)))
program-error)
(signals-error (mapcan #'cons '(a b c) '(1 2 3) '(4 5 6))
program-error)
t)
(deftest mapcan.error.8
(classify-error (mapcan #'identity (list* (list 1) (list 2) 3)))
type-error)
(signals-error (mapcan #'identity (list* (list 1) (list 2) 3))
type-error)
t)
......@@ -79,33 +79,33 @@
3 1 2 3)
(deftest mapcar.error.1
(classify-error (mapcar #'identity 1))