1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

(array-set!): Exercise byte array range checks.

This commit is contained in:
Kevin Ryde 2004-08-06 00:17:12 +00:00
parent 6002ebaf0e
commit 7f9ca7c3d7

View file

@ -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)))