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

« back to all changes in this revision

Viewing changes to ansi-tests/array-total-size.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:  Tue Jan 21 22:01:09 2003
 
4
;;;; Contains: Tests of ARRAY-TOTAL-SIZE
 
5
 
 
6
(in-package :cl-test)
 
7
 
 
8
;;; More tests of ARRAY-TOTAL-SIZE are in make-array.lsp
 
9
 
 
10
(deftest array-total-size.1
 
11
  (array-total-size #0aNIL)
 
12
  1)
 
13
 
 
14
(deftest array-total-size.2
 
15
  (array-total-size "abcdef")
 
16
  6)
 
17
 
 
18
(deftest array-total-size.3
 
19
  (array-total-size #(a b c))
 
20
  3)
 
21
 
 
22
(deftest array-total-size.4
 
23
  (array-total-size #*0011010)
 
24
  7)
 
25
 
 
26
(deftest array-total-size.5
 
27
  (array-total-size #2a((1 2 3)(4 5 6)(7 8 9)(a b c)))
 
28
  12)
 
29
 
 
30
(deftest array-total-size.order.1
 
31
  (let ((i 0) a)
 
32
    (values
 
33
     (array-total-size (progn (setf a (incf i)) #(a b c d)))
 
34
     i a))
 
35
  4 1 1)
 
36
 
 
37
;;; Error tests
 
38
 
 
39
(deftest array-total-size.error.1
 
40
  (signals-error (array-total-size) program-error)
 
41
  t)
 
42
 
 
43
(deftest array-total-size.error.2
 
44
  (signals-error (array-total-size #(a b c) nil) program-error)
 
45
  t)
 
46
 
 
47
(deftest array-total-size.error.3
 
48
  (loop for e in *mini-universe*
 
49
        unless (or (typep e 'array)
 
50
                   (eval `(signals-error (array-total-size ',e)
 
51
                                         type-error)))
 
52
        collect e)
 
53
  nil)
 
54
 
 
55
(deftest array-total-size.error.4
 
56
  (signals-error (array-total-size 0) type-error)
 
57
  t)
 
58
 
 
59
(deftest array-total-size.error.5
 
60
  (signals-error (locally (array-total-size 0) t)
 
61
                 type-error)
 
62
  t)