1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00

pass lump version in test_static_prop_lump_bytes

This commit is contained in:
Robin Appelman 2025-02-22 01:23:49 +01:00
commit c31dfda436
2 changed files with 10 additions and 2 deletions

View file

@ -227,7 +227,7 @@ struct RawStaticPropLump {
#[test]
fn test_static_prop_lump_bytes() {
super::test_read_bytes::<RawStaticPropLump>();
super::test_read_bytes_args::<RawStaticPropLump>((10,));
}
impl From<RawStaticPropLump> for StaticPropLump {

View file

@ -41,6 +41,14 @@ fn test_read_bytes<T: BinRead>()
where
T::Args<'static>: Default,
<T as BinRead>::Args<'static>: Clone,
{
test_read_bytes_args::<T>(T::Args::default())
}
#[cfg(test)]
fn test_read_bytes_args<T: BinRead>(args: T::Args<'static>)
where
<T as BinRead>::Args<'static>: Clone,
{
use binrw::BinReaderExt;
use std::any::type_name;
@ -48,7 +56,7 @@ where
let bytes = [0; 512];
let mut reader = Cursor::new(bytes);
let _ = reader.read_le::<T>().unwrap();
let _ = reader.read_le_args::<T>(args).unwrap();
assert_eq!(
reader.position() as usize,