projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6846ddb
)
If n is zero, there will be no higher bits set; skip this test.
author
Taylor R Campbell
<campbell@mumble.net>
Sat, 4 Nov 2017 03:19:51 +0000
(
03:19
+0000)
committer
Taylor R Campbell
<campbell@mumble.net>
Sat, 4 Nov 2017 03:19:51 +0000
(
03:19
+0000)
tests/runtime/test-integer-bits.scm
patch
|
blob
|
history
diff --git
a/tests/runtime/test-integer-bits.scm
b/tests/runtime/test-integer-bits.scm
index de479c2e5b37ff54df6f79a71eeecce58f3b56ae..b1dcead0d3df3399173bbd631fab897b1cf3662f 100644
(file)
--- 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))))