From 5aeb6729d1edcb3aa8c8f397f8563ad294dc3d64 Mon Sep 17 00:00:00 2001 From: Tom Kaitchuck Date: Sat, 10 Feb 2024 22:11:14 -0800 Subject: [PATCH] Make unit test endian independent (#206) Signed-off-by: Tom Kaitchuck --- src/operations.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/operations.rs b/src/operations.rs index a420587..98d8075 100644 --- a/src/operations.rs +++ b/src/operations.rs @@ -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); } }