From bf35ea027bf100dcf7d1a47ca5939c534ccefb03 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 7 Nov 2018 03:08:28 +0000 Subject: [PATCH] Confirm the primitive respects the bounds too. --- tests/microcode/test-chacha.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/microcode/test-chacha.scm b/tests/microcode/test-chacha.scm index 411c41063..fad879361 100644 --- a/tests/microcode/test-chacha.scm +++ b/tests/microcode/test-chacha.scm @@ -76,8 +76,12 @@ USA. (constant (string->utf8 "expand 32-byte k")) (primitive (make-primitive-procedure name 5))) (define (zv n) (make-bytevector n 0)) + (bytevector-u8-set! output 64 #xff) (primitive output 0 input key constant) + (assert-= (bytevector-u8-ref output 64) #xff) + (bytevector-u8-set! output 0 #xff) (primitive output 1 input key constant) + (assert-= (bytevector-u8-ref output 0) #xff) (assert-error (lambda () (primitive output -1 input key constant))) (assert-error (lambda () (primitive output 2 input key constant))) (assert-error (lambda () (primitive output 3 input key constant))) -- 2.25.1