From cf1a8bf0d45c45c67ca654eaf07619f12ecc4cf8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 26 Aug 2021 06:57:30 -0700 Subject: mmap test: bug: random buffer generation. * tests/017/mmap.tl: The random buffer procedure can generate buffers which are too small, because the random integer values are anywhere from 0 to the modulus. This showed up up on PPC-64 with 65536 byte pages. --- tests/017/mmap.tl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/017/mmap.tl b/tests/017/mmap.tl index 818540a5..639e256c 100644 --- a/tests/017/mmap.tl +++ b/tests/017/mmap.tl @@ -27,7 +27,8 @@ (assert (plusp page-size)) -(let* ((mk-rnd-buf (opip (expt 256 page-size) rand buf-uint)) +(let* ((buf-mod (trunc (expt 256 page-size) 2)) + (mk-rnd-buf (ret (flow buf-mod rand (+ buf-mod) buf-uint))) (rndbuf0 [mk-rnd-buf]) (rndbuf1 [mk-rnd-buf]) (fname "rand.bin")) -- cgit v1.2.3