diff options
author | Kevin Ryde <user42@zip.com.au> | 2004-08-06 00:17:12 +0000 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2004-08-06 00:17:12 +0000 |
commit | 7f9ca7c3d71bfa1d0d908e6165cfc1d2851972d3 (patch) | |
tree | 3623799bf54ed3ead4fafc7dca2241e896c44995 | |
parent | 6002ebaf0ee2d3bd596bd86f8d5eb2f39c3a17e3 (diff) | |
download | guile-7f9ca7c3d71bfa1d0d908e6165cfc1d2851972d3.tar.gz |
(array-set!): Exercise byte array range checks.
-rw-r--r-- | test-suite/tests/unif.test | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test-suite/tests/unif.test b/test-suite/tests/unif.test index 3915fe232..946cbba07 100644 --- a/test-suite/tests/unif.test +++ b/test-suite/tests/unif.test @@ -354,6 +354,28 @@ (with-test-prefix "array-set!" + (with-test-prefix "byte" + + (let ((a (make-uniform-array #\nul 1))) + + (pass-if "-128" + (begin (array-set! a -128 0) #t)) + (pass-if "0" + (begin (array-set! a 0 0) #t)) + (pass-if "127" + (begin (array-set! a 127 0) #t)) + (pass-if-exception "-129" exception:out-of-range + (begin (array-set! a -129 0) #t)) + (pass-if-exception "128" exception:out-of-range + (begin (array-set! a 128 0) #t)) + + (pass-if "#\\nul" + (begin (array-set! a #\nul 0) #t)) + (pass-if "#\\del" + (begin (array-set! a #\del 0) #t)) + (pass-if "char 255" + (begin (array-set! a (integer->char 255) 0) #t)))) + (with-test-prefix "short" (let ((a (make-uniform-array 's 1))) |