Skip to content

Commit 4ded317

Browse files
committed
Add another test for simple-array fixnum to make me feel safer
1 parent c2a45c1 commit 4ded317

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/cl-binary-store-tests.lisp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,19 @@
688688
do (loop for i fixnum below (length input) do (setf (aref input i) (random 256)))
689689
do (try input))))
690690

691+
(define-test simple-array-fixnum
692+
(let* ((n 1000)
693+
(arr (coerce (loop repeat n collect (random most-positive-fixnum))
694+
'(simple-array fixnum (*)))))
695+
(is 'equalp (restore (store nil arr)) arr))
696+
(let* ((n 10)
697+
(m 100)
698+
(arr (make-array (list n m) :element-type 'fixnum :initial-contents
699+
(loop repeat n
700+
collect
701+
(loop repeat m collect (random most-positive-fixnum))))))
702+
(is 'equalp (restore (store nil arr)) arr)))
703+
691704
(define-test simple-array-fixnum-malicious
692705
;; The below is a non-fixnum claiming to be in a fixnum array
693706
(finish

0 commit comments

Comments
 (0)