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

« back to all changes in this revision

Viewing changes to ansi-tests/adjustable-array-p.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:  Mon Jan 20 21:25:22 2003
 
4
;;;; Contains: Tests for ADJUSTABLE-ARRAY-P
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
(deftest adjustable-array-p.1
 
9
  (notnot (adjustable-array-p (make-array '(5) :adjustable t)))
 
10
  t)
 
11
 
 
12
(deftest adjustable-array-p.2
 
13
  (notnot (adjustable-array-p (make-array nil :adjustable t)))
 
14
  t)
 
15
 
 
16
(deftest adjustable-array-p.3
 
17
  (notnot (adjustable-array-p (make-array '(2 3) :adjustable t)))
 
18
  t)
 
19
 
 
20
(deftest adjustable-array-p.4
 
21
  (notnot (adjustable-array-p (make-array '(2 2 2) :adjustable t)))
 
22
  t)
 
23
 
 
24
(deftest adjustable-array-p.5
 
25
  (notnot (adjustable-array-p (make-array '(2 2 2 2) :adjustable t)))
 
26
  t)
 
27
 
 
28
(deftest adjustable-array-p.order.1
 
29
  (let ((i 0) x)
 
30
    (values
 
31
     (notnot (adjustable-array-p (progn (setf x (incf i))
 
32
                                        (make-array '(5) :adjustable t))))
 
33
     i x))
 
34
  t 1 1)
 
35
 
 
36
;;; Error tests
 
37
 
 
38
(deftest adjustable-array-p.error.1
 
39
  (signals-error (adjustable-array-p) program-error)
 
40
  t)
 
41
 
 
42
(deftest adjustable-array-p.error.2
 
43
  (signals-error (adjustable-array-p "aaa" nil) program-error)
 
44
  t)
 
45
 
 
46
(deftest adjustable-array-p.error.3
 
47
  (signals-error (adjustable-array-p 10) type-error)
 
48
  t)
 
49
 
 
50
(deftest adjustable-array-p.error.4
 
51
  (loop for e in *mini-universe*
 
52
        unless (or (typep e 'array)
 
53
                   (eval `(signals-error (adjustable-array-p ',e)
 
54
                                         type-error)))
 
55
        collect e)
 
56
  nil)
 
57
 
 
58
(deftest adjustable-array-p.error.5
 
59
  (signals-error (locally (adjustable-array-p 10)) type-error)
 
60
  t)
 
61
 
 
62
(deftest adjustable-array-p.error.6
 
63
  (signals-error (let ((x 10))
 
64
                    (locally (declare (optimize (safety 3)))
 
65
                           (adjustable-array-p x)))
 
66
                 type-error)
 
67
  t)