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:
parent
6002ebaf0e
commit
7f9ca7c3d7
1 changed files with 22 additions and 0 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue