From: Taylor R Campbell Date: Sat, 4 Nov 2017 03:19:51 +0000 (+0000) Subject: If n is zero, there will be no higher bits set; skip this test. X-Git-Tag: mit-scheme-pucked-9.2.12~14^2~10^2 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9907d31ffee5f0edd62bfd1b73ca206bd6bc6e96;p=mit-scheme.git If n is zero, there will be no higher bits set; skip this test. --- 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))))