summaryrefslogtreecommitdiffstats
path: root/tests/017
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-08-26 06:57:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-08-26 06:57:30 -0700
commit4822593b544baed61f0a3fa954d058dac66cc892 (patch)
treec760e94b36b19c2dd195aeef95f2d5d60fb84a22 /tests/017
parent80e1285c1051201d1ca33207635b908b64cef293 (diff)
downloadtxr-4822593b544baed61f0a3fa954d058dac66cc892.tar.gz
txr-4822593b544baed61f0a3fa954d058dac66cc892.tar.bz2
txr-4822593b544baed61f0a3fa954d058dac66cc892.zip
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.
Diffstat (limited to 'tests/017')
-rw-r--r--tests/017/mmap.tl3
1 files changed, 2 insertions, 1 deletions
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"))