diff --git a/rust/src/bits.rs b/rust/src/bits.rs index 25e927634..38f70e283 100644 --- a/rust/src/bits.rs +++ b/rust/src/bits.rs @@ -103,7 +103,7 @@ mod tests { if MEM_isLittleEndian() { assert_eq!(ZSTD_NbCommonBytes(0x0000_0000_0001_0000), 2); } else if MEM_64bits() { - assert_eq!(ZSTD_NbCommonBytes(0x0001_0000_0000_0000), 2); + assert_eq!(ZSTD_NbCommonBytes(0x0001_0000_0000_0000u64 as usize), 2); } else { assert_eq!(ZSTD_NbCommonBytes(0x0001_0000), 2); } diff --git a/rust/src/fse_compress.rs b/rust/src/fse_compress.rs index feba9d7d6..660af8cee 100644 --- a/rust/src/fse_compress.rs +++ b/rust/src/fse_compress.rs @@ -992,7 +992,11 @@ mod tests { assert_eq!(result, 5); assert_eq!(normalized, [3, 1, 4, 1, 5, 10, 2, 6]); assert_eq!(FSE_NCountWriteBound(4, 5), 6); - assert_eq!(FSE_compressBound(33), 557); + let input_size = 33usize; + assert_eq!( + FSE_compressBound(input_size), + FSE_NCOUNTBOUND + input_size + (input_size >> 7) + 4 + size_of::() + ); assert_eq!(FSE_optimalTableLog(12, 33, 4), 5); }