Skip to content

Commit

Permalink
skip calculating struct sizes on 32 bit platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ianic committed Feb 14, 2024
1 parent 415f68e commit 170cb15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/deflate.zig
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ const TestTokenWriter = struct {
};

test "flate.Deflate struct sizes" {
if (@sizeOf(usize) != 8) return error.SkipZigTest;

try expect(@sizeOf(Token) == 4);

// list: (1 << 15) * 4 = 128k + pos: 8
Expand Down
2 changes: 2 additions & 0 deletions src/inflate.zig
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ pub fn Inflate(comptime container: Container, comptime ReaderType: type) type {
}

test "flate.Inflate struct sizes" {
if (@sizeOf(usize) != 8) return error.SkipZigTest;

var fbs = std.io.fixedBufferStream("");
const ReaderType = @TypeOf(fbs.reader());
const inflate_size = @sizeOf(Inflate(.gzip, ReaderType));
Expand Down

0 comments on commit 170cb15

Please sign in to comment.