From b6489ff90afffcf0c69490efcb5941f3bb42fc3c Mon Sep 17 00:00:00 2001 From: tgschultz Date: Fri, 23 Nov 2018 22:29:40 -0600 Subject: Increased range of bitwidths tested by "serialize/deserialize Int" tests. Added tests for float inf and NaN. --- std/io.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'std/io.zig') diff --git a/std/io.zig b/std/io.zig index 219db124a0..499422fdcc 100644 --- a/std/io.zig +++ b/std/io.zig @@ -1050,8 +1050,13 @@ pub fn Deserializer(endian: builtin.Endian, is_packed: bool, comptime Error: typ else => in_stream, } }; } + + pub fn alignToByte(self: *Self) void { + if(!is_packed) return; + self.in_stream.alignToByte(); + } - //@BUG: inferred error issue + //@BUG: inferred error issue. See: #1386 fn deserializeInt(self: *Self, comptime T: type) (Stream.Error || error{EndOfStream})!T { debug.assert(trait.is(builtin.TypeId.Int)(T) or trait.is(builtin.TypeId.Float)(T)); -- cgit v1.2.3