Skip to content

Commit

Permalink
Make unit test endian independent
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Kaitchuck <[email protected]>
  • Loading branch information
tkaitchuck committed Feb 11, 2024
1 parent 722ca8a commit 63487bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,11 @@ mod test {

#[test]
fn test_add_length() {
let mut enc = (u64::MAX as u128) << 64 | 50;
let enc : [u64; 2] = [50, u64::MAX];
let mut enc : u128 = enc.convert();
add_in_length(&mut enc, u64::MAX);
assert_eq!(enc >> 64, u64::MAX as u128);
assert_eq!(enc as u64, 49);
let enc : [u64; 2] = enc.convert();
assert_eq!(enc[1], u64::MAX);
assert_eq!(enc[0], 49);
}
}

0 comments on commit 63487bc

Please sign in to comment.