From b8a2a16e8392f41c5fca5ff948a6e118ad0e5211 Mon Sep 17 00:00:00 2001 From: Tomusdrw Date: Fri, 15 Jan 2016 12:35:27 +0100 Subject: [PATCH] Fixing tests --- src/uint.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uint.rs b/src/uint.rs index f644cdb25..c37310cd0 100644 --- a/src/uint.rs +++ b/src/uint.rs @@ -409,7 +409,7 @@ macro_rules! construct_uint { let (v, mul_overflow) = self.overflowing_mul_u32((other >> (32 * i)).low_u32()); let (new_res, add_overflow) = res.overflowing_add(v << (32 * i)); res = new_res; - overflow = overflow || mul_overflow || add_overflow; + overflow |= mul_overflow | add_overflow; } (res, overflow) } @@ -964,17 +964,17 @@ mod tests { #[test] #[should_panic] fn uint256_pow_overflow () { - U256::from(2).pow(U256::from(0x001)); + U256::from(2).pow(U256::from(0x100)); } #[test] fn uint256_overflowing_pow () { assert_eq!( - U256::from(2).overflowing_pow(U256::from(0xfe)), - (U256::zero(), false) + U256::from(2).overflowing_pow(U256::from(0xff)), + (U256::from_str("8000000000000000000000000000000000000000000000000000000000000000").unwrap(), false) ); assert_eq!( - U256::from(2).overflowing_pow(U256::from(0x001)), + U256::from(2).overflowing_pow(U256::from(0x100)), (U256::zero(), true) ); }