Skip to content

Commit

Permalink
Fix tests that assume C char is signed
Browse files Browse the repository at this point in the history
These were failing to compile with `--all-features` on Linux on at least
`aarch64`, `ppc64le`, and `s390x` architectures.
  • Loading branch information
musicinmybrain committed Mar 10, 2024
1 parent 7b4a75d commit 7ac408b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libcramjam/src/capi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ mod tests {

#[test]
fn test_lz4_block_max_compressed_len() {
let mut error: *mut i8 = std::ptr::null_mut();
let mut error: *mut c_char = std::ptr::null_mut();
let len = lz4_block_max_compressed_len(10, &mut error);
assert!(error.is_null());
assert_eq!(len, 30);
Expand All @@ -823,7 +823,7 @@ mod tests {
let mut compressed = vec![0; snappy_raw_max_compressed_len(uncompressed.len())];
let nbytes_written = snappy::raw::compress(uncompressed, &mut compressed).unwrap();

let mut error: *mut i8 = std::ptr::null_mut();
let mut error: *mut c_char = std::ptr::null_mut();
let len = snappy_raw_decompressed_len(compressed.as_ptr(), nbytes_written, &mut error);

assert!(error.is_null());
Expand Down

0 comments on commit 7ac408b

Please sign in to comment.