fixed Deserializer.alignToByte() and added test coverage
parent
6d73e5de05
commit
3eca5a42e6
|
@ -1131,7 +1131,7 @@ pub fn Deserializer(comptime endian: builtin.Endian, comptime packing: Packing,
|
|||
}
|
||||
|
||||
pub fn alignToByte(self: *Self) void {
|
||||
if (!is_packed) return;
|
||||
if (packing == .Byte) return;
|
||||
self.in_stream.alignToByte();
|
||||
}
|
||||
|
||||
|
|
|
@ -417,6 +417,7 @@ fn testIntSerializerDeserializerInfNaN(
|
|||
const nan_check_f16 = try deserializer.deserialize(f16);
|
||||
const inf_check_f16 = try deserializer.deserialize(f16);
|
||||
const nan_check_f32 = try deserializer.deserialize(f32);
|
||||
deserializer.alignToByte();
|
||||
const inf_check_f32 = try deserializer.deserialize(f32);
|
||||
const nan_check_f64 = try deserializer.deserialize(f64);
|
||||
const inf_check_f64 = try deserializer.deserialize(f64);
|
||||
|
|
Loading…
Reference in New Issue