mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-07 06:44:11 +00:00
Closes #52. Fix test error "attempt to shift right with overflow".
Use wrapping function to directly disable integer overflow protection.
This commit is contained in:
parent
d7ba310294
commit
437b66d4ee
@ -656,9 +656,9 @@ mod test {
|
||||
for i in 0..60 {
|
||||
let num = rng.gen();
|
||||
let a = UInt32::constant(num).shr(i);
|
||||
let b = UInt32::constant(num >> i);
|
||||
let b = UInt32::constant(num.wrapping_shr(i as u32));
|
||||
|
||||
assert_eq!(a.value.unwrap(), num >> i);
|
||||
assert_eq!(a.value.unwrap(), num.wrapping_shr(i as u32));
|
||||
|
||||
assert_eq!(a.bits.len(), b.bits.len());
|
||||
for (a, b) in a.bits.iter().zip(b.bits.iter()) {
|
||||
|
Loading…
Reference in New Issue
Block a user