source: trunk/source/tests/ansi-tests/random-type-prop-tests-06.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 11 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 7.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Mar 13 15:33:55 2005
4;;;; Contains: Random type prop tests, part 6 (arrays)
5
6(in-package :cl-test)
7
8(def-type-prop-test adjustable-array-p 'adjustable-array-p '(array) 1)
9
10(def-type-prop-test aref.0 'aref '((array * nil)) 1)
11(def-type-prop-test aref.1 'aref (list '(array * (*)) (index-type-for-dim 0)) 2)
12(def-type-prop-test aref.2 'aref (list '(array * (* *)) (index-type-for-dim 0) (index-type-for-dim 1)) 3)
13(def-type-prop-test aref.3 'aref (list '(array * (* * *))
14                                       (index-type-for-dim 0) (index-type-for-dim 1) (index-type-for-dim 2))
15  4)
16
17(def-type-prop-test array-dimension 'array-dimension
18  (list 'array #'(lambda (x) (let ((r (array-rank x))) (and (> r 0) `(integer 0 (,r))))))
19  2)
20(def-type-prop-test array-dimensions 'array-dimensions '(array) 1)
21(def-type-prop-test array-element-type 'array-element-type '(array) 1)
22(def-type-prop-test array-has-fill-pointer-p.1 'array-has-fill-pointer-p '(array) 1)
23(def-type-prop-test array-has-fill-pointer-p.2 'array-has-fill-pointer-p '(vector) 1)
24(def-type-prop-test array-displacement.1 'array-displacement '(array) 1)
25(def-type-prop-test array-displacement.2 'array-displacement '(vector) 1)
26
27(def-type-prop-test array-in-bounds-p.0 'array-in-bounds-p '((array * nil)) 1)
28(def-type-prop-test array-in-bounds-p.1 'array-in-bounds-p (list '(array * (*)) (index-type-for-dim 0)) 2)
29(def-type-prop-test array-in-bounds-p.2 'array-in-bounds-p
30  (list '(array * (* *)) (index-type-for-dim 0) (index-type-for-dim 1)) 3)
31(def-type-prop-test array-in-bounds-p.3 'array-in-bounds-p
32  (list '(array * (* * *)) (index-type-for-dim 0) (index-type-for-dim 1) (index-type-for-dim 2))
33  4)
34(def-type-prop-test array-in-bounds-p.4 'array-in-bounds-p '((array * (*)) integer) 2)
35(def-type-prop-test array-in-bounds-p.5 'array-in-bounds-p '((array * (* *)) integer integer) 3)
36(def-type-prop-test array-in-bounds-p.6 'array-in-bounds-p '((array * (* * *)) integer integer integer) 4)
37(def-type-prop-test array-rank 'array-rank '(array) 1)
38
39(def-type-prop-test array-row-major-index.0 'array-row-major-index '((array * nil)) 1)
40(def-type-prop-test array-row-major-index.1 'array-row-major-index (list '(array * (*)) (index-type-for-dim 0)) 2)
41(def-type-prop-test array-row-major-index.2 'array-row-major-index
42  (list '(array * (* *)) (index-type-for-dim 0) (index-type-for-dim 1)) 3)
43(def-type-prop-test array-row-major-index.3 'array-row-major-index
44  (list '(array * (* * *)) (index-type-for-dim 0) (index-type-for-dim 1) (index-type-for-dim 2))
45  4)
46(def-type-prop-test array-total-size 'array-total-size '(array) 1)
47
48(def-type-prop-test arrayp 'arrayp '(t) 1)
49
50(def-type-prop-test fill-pointer '(lambda (x) (and (array-has-fill-pointer-p x) (fill-pointer x))) '(vector) 1)
51
52(def-type-prop-test row-major-aref 'row-major-aref
53  (list 'array #'(lambda (a) (let ((s (array-total-size a))) (and (> s 0) `(integer 0 (,s))))))
54  2)
55
56(def-type-prop-test upgraded-array-element-type 'upgraded-array-element-type
57  (list #'(lambda () (let ((x (make-random-element-of-type t)))
58                       `(eql ,(make-random-type-containing x)))))
59  1)
60
61(def-type-prop-test simple-vector-p.1 'simple-vector-p '(t) 1)
62(def-type-prop-test simple-vector-p.2 'simple-vector-p '(vector) 1)
63
64(def-type-prop-test svref 'svref (list 'simple-vector (index-type-for-dim 0)) 2)
65(def-type-prop-test vector 'vector nil 1 :rest-type t :maxargs 10)
66(def-type-prop-test vectorp.1 'vectorp '(t) 1)
67(def-type-prop-test vectorp.2 'vectorp '(array) 1)
68
69(def-type-prop-test bit.1 'bit (list '(array bit (*)) (index-type-for-dim 0)) 2)
70(def-type-prop-test bit.2 'bit (list '(array bit (* *)) (index-type-for-dim 0) (index-type-for-dim 1)) 3)
71(def-type-prop-test bit.3 'bit
72  (list '(array bit (* * *)) (index-type-for-dim 0) (index-type-for-dim 1) (index-type-for-dim 2))
73  4)
74
75(def-type-prop-test sbit.1 'sbit (list '(simple-array bit (*)) (index-type-for-dim 0)) 2)
76(def-type-prop-test sbit.2 'sbit (list '(simple-array bit (* *)) (index-type-for-dim 0) (index-type-for-dim 1)) 3)
77(def-type-prop-test sbit.3 'sbit
78  (list '(simple-array bit (* * *)) (index-type-for-dim 0) (index-type-for-dim 1) (index-type-for-dim 2))
79  4)
80
81
82(def-type-prop-test bit-and.1 'bit-and (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
83                                                                          `(array bit ,dims))))
84  2)
85(def-type-prop-test bit-and.2 'bit-and
86  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
87  3)
88(def-type-prop-test bit-andc1.1 'bit-andc1 (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
89                                                                          `(array bit ,dims))))
90  2)
91(def-type-prop-test bit-andc1.2 'bit-andc1
92  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
93  3)
94(def-type-prop-test bit-andc2.1 'bit-andc2 (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
95                                                                          `(array bit ,dims))))
96  2)
97(def-type-prop-test bit-andc2.2 'bit-andc2
98  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
99  3)
100(def-type-prop-test bit-ior.1 'bit-ior (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
101                                                                          `(array bit ,dims))))
102  2)
103(def-type-prop-test bit-ior.2 'bit-ior
104  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
105  3)
106(def-type-prop-test bit-orc1.1 'bit-orc1 (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
107                                                                          `(array bit ,dims))))
108  2)
109(def-type-prop-test bit-orc1.2 'bit-orc1
110  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
111  3)
112(def-type-prop-test bit-orc2.1 'bit-orc2 (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
113                                                                          `(array bit ,dims))))
114  2)
115(def-type-prop-test bit-orc2.2 'bit-orc2
116  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
117  3)
118(def-type-prop-test bit-eqv.1 'bit-eqv (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
119                                                                          `(array bit ,dims))))
120  2)
121(def-type-prop-test bit-eqv.2 'bit-eqv
122  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
123  3)
124(def-type-prop-test bit-xor.1 'bit-xor (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
125                                                                          `(array bit ,dims))))
126  2)
127(def-type-prop-test bit-xor.2 'bit-xor
128  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
129  3)
130(def-type-prop-test bit-nand.1 'bit-nand (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
131                                                                          `(array bit ,dims))))
132  2)
133(def-type-prop-test bit-nand.2 'bit-nand
134  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
135  3)
136(def-type-prop-test bit-nor.1 'bit-nor (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a)))
137                                                                          `(array bit ,dims))))
138  2)
139(def-type-prop-test bit-nor.2 'bit-nor
140  (list '(array bit) #'(lambda (a) (let ((dims (array-dimensions a))) `(array bit ,dims))) 'null)
141  3)
142(def-type-prop-test bit-not.1 'bit-not '((array bit)) 1)
143(def-type-prop-test bit-not.2 'bit-not '((array bit) null) 2)
144
145(def-type-prop-test bit-vector-p 'bit-vector-p '(t) 1)
146(def-type-prop-test simple-bit-vector-p 'simple-bit-vector-p '(t) 1)
Note: See TracBrowser for help on using the repository browser.