summaryrefslogtreecommitdiffstats
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
commitcf1a8bf0d45c45c67ca654eaf07619f12ecc4cf8 (patch)
treec760e94b36b19c2dd195aeef95f2d5d60fb84a22
parentb372010ba7fe7348dd218d8fb92ae5b53933bbdd (diff)
downloadtxr-cf1a8bf0d45c45c67ca654eaf07619f12ecc4cf8.tar.gz
txr-cf1a8bf0d45c45c67ca654eaf07619f12ecc4cf8.tar.bz2
txr-cf1a8bf0d45c45c67ca654eaf07619f12ecc4cf8.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.
-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"))