diff --git a/rust/src/fileio_asyncio.rs b/rust/src/fileio_asyncio.rs index d4affddf7..b9a060670 100644 --- a/rust/src/fileio_asyncio.rs +++ b/rust/src/fileio_asyncio.rs @@ -6980,11 +6980,18 @@ mod tests { assert_eq!(to_flush_now, 19); assert_eq!(zstd_result, 0); - state.codec_result = usize::MAX; + let mut error_state = ZstdCodecCallbackTestState { + pending_flush: 19, + codec_result: usize::MAX, + observed_input: None, + observed_output: None, + observed_directive: -1, + }; + let error_cctx = (&mut error_state as *mut ZstdCodecCallbackTestState).cast::(); assert_eq!( unsafe { fio_zstd_compress_stream_with( - cctx, + error_cctx, 0, input.as_ptr(), input.len(),