Commit bfeebad5 authored by pfdietz's avatar pfdietz

Changed classify-error forms to signals-error forms.

parent bd6c8796
......@@ -51,25 +51,25 @@
t 1)
(deftest fboundp.error.1
(classify-error (fboundp 1))
type-error)
(signals-error (fboundp 1) type-error)
t)
(deftest fboundp.error.2
(classify-error (fboundp #\a))
type-error)
(signals-error (fboundp #\a) type-error)
t)
(deftest fboundp.error.3
(classify-error (fboundp '(foo)))
type-error)
(signals-error (fboundp '(foo)) type-error)
t)
(deftest fboundp.error.4
(classify-error (fboundp))
program-error)
(signals-error (fboundp) program-error)
t)
(deftest fboundp.error.5
(classify-error (fboundp 'cons nil))
program-error)
(signals-error (fboundp 'cons nil) program-error)
t)
(deftest fboundp.error.6
(classify-error (locally (fboundp 1) t))
type-error)
(signals-error (locally (fboundp 1) t) type-error)
t)
......@@ -9,12 +9,12 @@
(ignore-errors (compile-and-load "fceiling-aux.lsp"))
(deftest fceiling.error.1
(classify-error (fceiling))
program-error)
(signals-error (fceiling) program-error)
t)
(deftest fceiling.error.2
(classify-error (fceiling 1.0 1 nil))
program-error)
(signals-error (fceiling 1.0 1 nil) program-error)
t)
;;;
......
......@@ -8,28 +8,28 @@
;;; Error cases
(deftest fdefinition.error.1
(classify-error (fdefinition))
program-error)
(signals-error (fdefinition) program-error)
t)
(deftest fdefinition.error.2
(classify-error (fdefinition 'cons nil))
program-error)
(signals-error (fdefinition 'cons nil) program-error)
t)
(deftest fdefinition.error.3
(classify-error (fdefinition (gensym)))
undefined-function)
(signals-error (fdefinition (gensym)) undefined-function)
t)
(deftest fdefinition.error.4
(classify-error (fdefinition 10))
type-error)
(signals-error (fdefinition 10) type-error)
t)
(deftest fdefinition.error.5
(classify-error (fdefinition (list 'setf (gensym))))
undefined-function)
(signals-error (fdefinition (list 'setf (gensym))) undefined-function)
t)
(deftest fdefinition.error.6
(classify-error (locally (fdefinition 10) t))
type-error)
(signals-error (locally (fdefinition 10) t) type-error)
t)
;;; Non-error cases
......
......@@ -9,12 +9,12 @@
(ignore-errors (compile-and-load "ffloor-aux.lsp"))
(deftest ffloor.error.1
(classify-error (ffloor))
program-error)
(signals-error (ffloor) program-error)
t)
(deftest ffloor.error.2
(classify-error (ffloor 1.0 1 nil))
program-error)
(signals-error (ffloor 1.0 1 nil) program-error)
t)
;;;
......
......@@ -58,27 +58,26 @@
;;; Error tests
(deftest file-author.error.1
(classify-error (file-author))
program-error)
(signals-error (file-author) program-error)
t)
(deftest file-author.error.2
(classify-error (file-author "file-author.lsp" nil))
program-error)
(signals-error (file-author "file-author.lsp" nil) program-error)
t)
(deftest file-author.error.3
(classify-error
(signals-error
(file-author (make-pathname :name :wild :type "lsp"
:defaults *default-pathname-defaults*)))
file-error)
:defaults *default-pathname-defaults*))
file-error)
t)
(deftest file-author.error.4
(classify-error
(signals-error
(file-author (make-pathname :name "file-author" :type :wild
:defaults *default-pathname-defaults*)))
file-error)
:defaults *default-pathname-defaults*))
file-error)
t)
......
......@@ -74,14 +74,14 @@
t t t)
(deftest file-error-pathname.error.1
(classify-error (file-error-pathname))
program-error)
(signals-error (file-error-pathname) program-error)
t)
(deftest file-error-pathname.error.2
(classify-error (file-error-pathname (make-condition 'file-error :pathname "foo.txt") nil))
program-error)
(signals-error
(file-error-pathname (make-condition 'file-error :pathname "foo.txt") nil)
program-error)
t)
......
......@@ -56,21 +56,24 @@
;;;
(deftest file-write-date.error.1
(classify-error (file-write-date))
program-error)
(signals-error (file-write-date) program-error)
t)
(deftest file-write-date.error.2
(classify-error (file-write-date "file-write-date.lsp" nil))
program-error)
(signals-error (file-write-date "file-write-date.lsp" nil)
program-error)
t)
(deftest file-write-date.error.3
(classify-error
(signals-error
(file-write-date (make-pathname :name :wild :type "lsp"
:defaults *default-pathname-defaults*)))
file-error)
:defaults *default-pathname-defaults*))
file-error)
t)
(deftest file-write-date.error.4
(classify-error
(signals-error
(file-write-date (make-pathname :name "file-write-date" :type :wild
:defaults *default-pathname-defaults*)))
file-error)
:defaults *default-pathname-defaults*))
file-error)
t)
......@@ -47,36 +47,38 @@
;;; Error tests
(deftest fill-pointer.error.1
(classify-error (fill-pointer))
program-error)
(signals-error (fill-pointer) program-error)
t)
(deftest fill-pointer.error.2
(classify-error (fill-pointer (make-array '(10) :fill-pointer 4)
nil))
program-error)
(signals-error (fill-pointer (make-array '(10) :fill-pointer 4) nil)
program-error)
t)
(deftest fill-pointer.error.3
(classify-error (fill-pointer (make-array '(10) :fill-pointer nil)))
type-error)
(signals-error (fill-pointer (make-array '(10) :fill-pointer nil))
type-error)
t)
(deftest fill-pointer.error.4
(classify-error (fill-pointer #0aNIL))
type-error)
(signals-error (fill-pointer #0aNIL) type-error)
t)
(deftest fill-pointer.error.5
(classify-error (fill-pointer #2a((a b c)(d e f))))
type-error)
(signals-error (fill-pointer #2a((a b c)(d e f))) type-error)
t)
(deftest fill-pointer.error.6
(let (why)
(loop for e in *mini-universe*
when (and (or (not (typep e 'vector))
(not (array-has-fill-pointer-p e)))
(not (eql (setq why (classify-error** `(fill-pointer ',e)))
'type-error)))
collect (list e why)))
(loop for e in *mini-universe*
when (and (or (not (typep e 'vector))
(not (array-has-fill-pointer-p e)))
(not (eval `(signals-error
(fill-pointer ',e)
type-error))))
collect (list e))
nil)
(deftest fill-pointer.error.7
(classify-error (locally (fill-pointer #2a((a b c)(d e f))) t))
type-error)
(signals-error (locally (fill-pointer #2a((a b c)(d e f))) t)
type-error)
t)
......@@ -6,45 +6,47 @@
(in-package :cl-test)
(deftest fill.error.1
(classify-error (fill 'a 'b))
type-error)
(signals-error (fill 'a 'b) type-error)
t)
(deftest fill.error.2
(classify-error (fill))
program-error)
(signals-error (fill) program-error)
t)
(deftest fill.error.3
(classify-error (fill (list 'a 'b)))
program-error)
(signals-error (fill (list 'a 'b)) program-error)
t)
(deftest fill.error.4
(classify-error (fill (list 'a 'b) 'c :bad t))
program-error)
(signals-error (fill (list 'a 'b) 'c :bad t) program-error)
t)
(deftest fill.error.5
(classify-error (fill (list 'a 'b) 'c :bad t :allow-other-keys nil))
program-error)
(signals-error (fill (list 'a 'b) 'c :bad t :allow-other-keys nil)
program-error)
t)
(deftest fill.error.6
(classify-error (fill (list 'a 'b) 'c :start))
program-error)
(signals-error (fill (list 'a 'b) 'c :start) program-error)
t)
(deftest fill.error.7
(classify-error (fill (list 'a 'b) 'c :end))
program-error)
(signals-error (fill (list 'a 'b) 'c :end) program-error)
t)
(deftest fill.error.8
(classify-error (fill (list 'a 'b) 'c 1 2))
program-error)
(signals-error (fill (list 'a 'b) 'c 1 2) program-error)
t)
(deftest fill.error.10
(classify-error (fill (list 'a 'b) 'c :bad t :allow-other-keys nil
:allow-other-keys t))
program-error)
(signals-error (fill (list 'a 'b) 'c :bad t :allow-other-keys nil
:allow-other-keys t)
program-error)
t)
(deftest fill.error.11
(classify-error (locally (fill 'a 'b) t))
type-error)
(signals-error (locally (fill 'a 'b) t) type-error)
t)
;;; Fill on arrays
......@@ -91,28 +93,32 @@
t (x x x x x))
(deftest array-fill-7
(classify-error
(signals-error
(let* ((a (make-array '(5))))
(fill a 'x :start -1)))
type-error)
(fill a 'x :start -1))
type-error)
t)
(deftest array-fill-8
(classify-error
(signals-error
(let* ((a (make-array '(5))))
(fill a 'x :start 'a)))
type-error)
(fill a 'x :start 'a))
type-error)
t)
(deftest array-fill-9
(classify-error
(signals-error
(let* ((a (make-array '(5))))
(fill a 'x :end -1)))
type-error)
(fill a 'x :end -1))
type-error)
t)
(deftest array-fill-10
(classify-error
(signals-error
(let* ((a (make-array '(5))))
(fill a 'x :end 'a)))
type-error)
(fill a 'x :end 'a))
type-error)
t)
;;; fill on arrays of fixnums
......@@ -159,28 +165,32 @@
t (-1 -1 -1 -1 -1))
(deftest array-fixnum-fill-7
(classify-error
(signals-error
(let* ((a (make-array '(5) :element-type 'fixnum)))
(fill a 10 :start -1)))
type-error)
(fill a 10 :start -1))
type-error)
t)
(deftest array-fixnum-fill-8
(classify-error
(signals-error
(let* ((a (make-array '(5) :element-type 'fixnum)))
(fill a 100 :start 'a)))
type-error)
(fill a 100 :start 'a))
type-error)
t)
(deftest array-fixnum-fill-9
(classify-error
(signals-error
(let* ((a (make-array '(5) :element-type 'fixnum)))
(fill a -5 :end -1)))
type-error)
(fill a -5 :end -1))
type-error)
t)
(deftest array-fixnum-fill-10
(classify-error
(signals-error
(let* ((a (make-array '(5) :element-type 'fixnum)))
(fill a 17 :end 'a)))
type-error)
(fill a 17 :end 'a))
type-error)
t)
;;; fill on arrays of unsigned eight bit bytes
......@@ -209,20 +219,24 @@
t (0 0 0 0 0))
(deftest array-unsigned-byte8-fill-7
(classify-error (array-unsigned-byte-fill-test-fn 8 0 :start -1))
type-error)
(signals-error (array-unsigned-byte-fill-test-fn 8 0 :start -1)
type-error)
t)
(deftest array-unsigned-byte8-fill-8
(classify-error (array-unsigned-byte-fill-test-fn 8 100 :start 'a))
type-error)
(signals-error (array-unsigned-byte-fill-test-fn 8 100 :start 'a)
type-error)
t)
(deftest array-unsigned-byte8-fill-9
(classify-error (array-unsigned-byte-fill-test-fn 8 19 :end -1))
type-error)
(signals-error (array-unsigned-byte-fill-test-fn 8 19 :end -1)
type-error)
t)
(deftest array-unsigned-byte8-fill-10
(classify-error (array-unsigned-byte-fill-test-fn 8 17 :end 'a))
type-error)
(signals-error (array-unsigned-byte-fill-test-fn 8 17 :end 'a)
type-error)
t)
;;; Tests on arrays with fill pointers
......
......@@ -278,9 +278,9 @@
;;; Error tests
(deftest find-class.error.1
(classify-error (find-class))
program-error)
(signals-error (find-class) program-error)
t)
(deftest find-class.error.2
(classify-error (find-class 'symbol nil nil nil))
program-error)
(signals-error (find-class 'symbol nil nil nil) program-error)
t)
......@@ -514,64 +514,68 @@
;;; Error tests
(deftest find-if-not.error.1
(classify-error (find-if-not #'null 'b))
type-error)
(signals-error (find-if-not #'null 'b) type-error)
t)
(deftest find-if-not.error.2
(classify-error (find-if-not #'identity 10))
type-error)
(signals-error (find-if-not #'identity 10) type-error)
t)
(deftest find-if-not.error.3
(classify-error (find-if-not '1+ 1.4))
type-error)
(signals-error (find-if-not '1+ 1.4) type-error)
t)
(deftest find-if-not.error.4
(classify-error (find-if-not 'identity '(a b c . d)))
type-error)
(signals-error (find-if-not 'identity '(a b c . d))
type-error)
t)
(deftest find-if-not.error.5
(classify-error (find-if-not))
program-error)
(signals-error (find-if-not) program-error)
t)
(deftest find-if-not.error.6
(classify-error (find-if-not #'null))
program-error)
(signals-error (find-if-not #'null) program-error)
t)
(deftest find-if-not.error.7
(classify-error (find-if-not #'null nil :bad t))
program-error)
(signals-error (find-if-not #'null nil :bad t) program-error)
t)
(deftest find-if-not.error.8
(classify-error (find-if-not #'null nil :bad t :allow-other-keys nil))
program-error)
(signals-error (find-if-not #'null nil :bad t :allow-other-keys nil)
program-error)
t)
(deftest find-if-not.error.9
(classify-error (find-if-not #'null nil 1 1))
program-error)
(signals-error (find-if-not #'null nil 1 1) program-error)
t)
(deftest find-if-not.error.10
(classify-error (find-if-not #'null nil :key))
program-error)
(signals-error (find-if-not #'null nil :key) program-error)
t)
(deftest find-if-not.error.11
(classify-error (locally (find-if-not #'null 'b) t))
type-error)
(signals-error (locally (find-if-not #'null 'b) t) type-error)
t)
(deftest find-if-not.error.12
(classify-error (find-if-not #'cons '(a b c)))
program-error)
(signals-error (find-if-not #'cons '(a b c)) program-error)
t)
(deftest find-if-not.error.13
(classify-error (find-if-not #'car '(a b c)))
type-error)
(signals-error (find-if-not #'car '(a b c)) type-error)
t)
(deftest find-if-not.error.14
(classify-error (find-if-not #'identity '(a b c) :key #'cons))
program-error)
(signals-error (find-if-not #'identity '(a b c) :key #'cons)
program-error)
t)
(deftest find-if-not.error.15
(classify-error (find-if-not #'identity '(a b c) :key #'car))
type-error)
(signals-error (find-if-not #'identity '(a b c) :key #'car)
type-error)
t)
;;; Order of evaluation tests
......
......@@ -537,64 +537,66 @@
;;; Error tests
(deftest find-if.error.1
(classify-error (find-if #'null 'b))
type-error)
(signals-error (find-if #'null 'b) type-error)
t)
(deftest find-if.error.2
(classify-error (find-if #'identity 10))
type-error)
(signals-error (find-if #'identity 10) type-error)
t)
(deftest find-if.error.3
(classify-error (find-if '1+ 1.4))
type-error)
(signals-error (find-if '1+ 1.4) type-error)
t)
(deftest find-if.error.4
(classify-error (find-if 'null '(a b c . d)))
type-error)
(signals-error (find-if 'null '(a b c . d)) type-error)
t)
(deftest find-if.error.5
(classify-error (find-if))
program-error)
(signals-error (find-if) program-error)
t)
(deftest find-if.error.6
(classify-error (find-if #'null))
program-error)
(signals-error (find-if #'null) program-error)
t)
(deftest find-if.error.7
(classify-error (find-if #'null nil :bad t))
program-error)
(signals-error (find-if #'null nil :bad t) program-error)
t)
(deftest find-if.error.8
(classify-error (find-if #'null nil :bad t :allow-other-keys nil))
program-error)
(signals-error (find-if #'null nil :bad t :allow-other-keys nil)
program-error)
t)
(deftest find-if.error.9
(classify-error (find-if #'null nil 1 1))
program-error)
(signals-error (find-if #'null nil 1 1) program-error)
t)
(deftest find-if.error.10
(classify-error (find-if #'null nil :key))
program-error)
(signals-error (find-if #'null nil :key) program-error)
t)
(deftest find-if.error.11
(classify-error (locally (find-if #'null 'b) t))
type-error)
(signals-error (locally (find-if #'null 'b) t) type-error)
t)
(deftest find-if.error.12
(classify-error (find-if #'cons '(a b c)))
program-error)
(signals-error (find-if #'cons '(a b c)) program-error)
t)
(deftest find-if.error.13
(classify-error (find-if #'car '(a b c)))
type-error)
(signals-error (find-if #'car '(a b c)) type-error)
t)
(deftest find-if.error.14
(classify-error (find-if #'identity '(a b c) :key #'cons))
program-error)
(signals-error (find-if #'identity '(a b c) :key #'cons) program-error)
t)
(deftest find-if.error.15
(classify-error (find-if #'identity '(a b c) :key #'car))
type-error)
(signals-error (find-if #'identity '(a b c) :key #'car)
type-error)
t)
;;; Order of evaluation tests
......
......@@ -84,21 +84,22 @@
;;; Error tests
(deftest find-method.error.1
(classify-error (find-method))
program-error)
(signals-error (find-method) program-error)
t)
(deftest find-method.error.2
(classify-error (find-method #'find-method-gf-01))
program-error)
(signals-error (find-method #'find-method-gf-01) program-error)
t)
(deftest find-method.error.3
(classify-error (find-method #'find-method-gf-01 nil))
program-error)
(signals-error (find-method #'find-method-gf-01 nil) program-error)
t)
(deftest find-method.error.4
(classify-error
(find-method #'find-method-gf-01 nil (list (find-class 'integer)) nil nil))
program-error)
(signals-error
(find-method #'find-method-gf-01 nil (list (find-class 'integer)) nil nil)
program-error)
t)
(deftest find-method.error.5
(handler-case
......
......@@ -839,64 +839,65 @@
;;; Error tests
(deftest find.error.1
(classify-error (find 'a 'b))
type-error)
(signals-error (find 'a 'b) type-error)
t)
(deftest find.error.2
(classify-error (find 'a 10))
type-error)
(signals-error (find 'a 10) type-error)
t)
(deftest find.error.3
(classify-error (find 'a 1.4))
type-error)
(signals-error (find 'a 1.4) type-error)
t)
(deftest find.error.4
(classify-error (find 'e '(a b c . d)))
type-error)
(signals-error (find 'e '(a b c . d)) type-error)
t)
(deftest find.error.5
(classify-error (find))
program-error)
(signals-error (find) program-error)
t)
(deftest find.error.6
(classify-error (find 'a))
program-error)
(signals-error (find 'a) program-error)
t)
(deftest find.error.7
(classify-error (find 'a nil :bad t))
program-error)
(signals-error (find 'a nil :bad t) program-error)
t)
(deftest find.error.8
(classify-error (find 'a nil :bad t :allow-other-keys nil))
program-error)
(signals-error (find 'a nil :bad t :allow-other-keys nil)
program-error)
t)
(deftest find.error.9
(classify-error (find 'a nil 1 1))
program-error)
(signals-error (find 'a nil 1 1) program-error)
t)
(deftest find.error.10