From 9907d31ffee5f0edd62bfd1b73ca206bd6bc6e96 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 4 Nov 2017 03:19:51 +0000 Subject: [PATCH] If n is zero, there will be no higher bits set; skip this test. --- tests/runtime/test-integer-bits.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/runtime/test-integer-bits.scm b/tests/runtime/test-integer-bits.scm index de479c2e5..b1dcead0d 100644 --- a/tests/runtime/test-integer-bits.scm +++ b/tests/runtime/test-integer-bits.scm @@ -435,7 +435,8 @@ USA. 'EXPRESSION `(FFS ,n)) (assert-= (ffs n) (+ 1 (first-set-bit n)) 'EXPRESSION `(FFS ,n)) (assert-= (ffs (- 0 n)) (ffs n) 'EXPRESSION `(FFS (- 0 ,n))) - (assert->= (ffs n) (+ i 1) 'EXPRESSION `(FFS ,n)) + (if (not (zero? n)) + (assert->= (ffs n) (+ i 1) 'EXPRESSION `(FFS ,n))) ;; Set the ith bit of n and make equality hold exactly. (assert-= (ffs (bitwise-ior n (shift-left 1 i))) (+ i 1) 'EXPRESSION `(FFS (BITWISE-IOR ,n (SHIFT-LEFT 1 ,i)))) -- 2.25.1