From 93a773ab255357b6a4a7629ea2baf869d0bd585d Mon Sep 17 00:00:00 2001 From: Senryoku Date: Sun, 6 Oct 2024 18:05:26 +0200 Subject: [PATCH] zig 0.14.0-dev.1710+8ee52f99c --- .github/workflows/zig.yml | 7 +++++-- .zigversion | 2 +- src/lzw.zig | 12 +----------- src/wasm.zig | 6 +++--- ts-lib/src/module.wasm | Bin 8178 -> 8118 bytes 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/zig.yml b/.github/workflows/zig.yml index 96eb660..ba4ccba 100644 --- a/.github/workflows/zig.yml +++ b/.github/workflows/zig.yml @@ -16,8 +16,11 @@ jobs: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 with: - version: 0.13.0 - - run: zig build test --summary all + version: 0.14.0-dev.1710+8ee52f99c + - run: zig build test --summary all + if: matrix.os == 'windows-latest' # Fuzzing is not supported on Windows yet + - run: zig build test --fuzz --summary all + if: matrix.os != 'windows-latest' lint: runs-on: ubuntu-latest steps: diff --git a/.zigversion b/.zigversion index 51de330..21f5176 100644 --- a/.zigversion +++ b/.zigversion @@ -1 +1 @@ -0.13.0 \ No newline at end of file +0.14.0-dev.1710+8ee52f99c \ No newline at end of file diff --git a/src/lzw.zig b/src/lzw.zig index c2a0795..190f4e6 100644 --- a/src/lzw.zig +++ b/src/lzw.zig @@ -162,17 +162,7 @@ test "basic" { test "fuzzing" { // Doesn't ensure that the string is valid UTF-8, but it should not matter. - // Note: In the future, use std.testing.random_seed. See https://github.com/ziglang/zig/issues/17609. - const seed = std.crypto.random.int(u64); - errdefer std.debug.print("\nFuzzing Test FAILED\n\tSeed: {d}\n", .{seed}); - var rng = std.rand.DefaultPrng.init(seed); - for (0..10) |_| { - const length = rng.random().intRangeAtMost(usize, 0, 10_000_000); // Up to ~10MB - const str = try std.testing.allocator.alloc(u8, length); - defer std.testing.allocator.free(str); - rng.fill(str); - try testRound(str); - } + return std.testing.fuzz(testRound, .{}); } fn testFile(path: []const u8) !void { diff --git a/src/wasm.zig b/src/wasm.zig index a0c248c..e5ec10a 100644 --- a/src/wasm.zig +++ b/src/wasm.zig @@ -6,9 +6,9 @@ const impl = @import("lzw.zig"); const wasmAllocator = @import("./wasmAllocator.zig"); comptime { - @export(wasmAllocator.allocUint8, .{ .name = "allocUint8", .linkage = .strong }); - @export(wasmAllocator.allocUint16, .{ .name = "allocUint16", .linkage = .strong }); - @export(wasmAllocator.free, .{ .name = "free", .linkage = .strong }); + @export(&wasmAllocator.allocUint8, .{ .name = "allocUint8", .linkage = .strong }); + @export(&wasmAllocator.allocUint16, .{ .name = "allocUint16", .linkage = .strong }); + @export(&wasmAllocator.free, .{ .name = "free", .linkage = .strong }); } comptime { diff --git a/ts-lib/src/module.wasm b/ts-lib/src/module.wasm index c0a961a16926842ae0c8afcc2078b3e40632ac5b..fb008d320e298fdaccdf26176cb3f7298a7bb806 100644 GIT binary patch delta 2063 zcmZuyO=ule6u#%)`F%6*W%BcyG%soH9it|wEur{Ys*>DFV$qhgv_-^Ci$-u>v80Ar zL_1GfwTmt+*R{F}6a*pa*18bfxvDEcm)R7GxG5;{J2Ppc&=+22&YgR|^PTT}XWpOl z-_L)xJg3UCr1G4HODWD#Db&76DZ?lxUnwc2QjNrysvz)h_Kz&=X`H`s;o=)- z-+pK9uozDs26J7}@!q<$vLYtpn1rQ74GoW^BpW|IKl!YrlCEfJ<=V~dr;>-E;&5|? zHbVN?HRC1Pa%bXCX>0ShxS+}Y_KQN?F7+5LLcE^)9W$!^rqs%cW1B0}8`;N;FO=3kF&q)z>!wIY=T`i%mR20xu7}1+A)F zIt1X~4Iz>$L-mAVb53e+-MMw=eeHF4SC#dbp>|t!CDcwVnIO@=&5CKE19yMuN!OnE zwY5#y9KO50s>5|l?*7CK4Y+*L9lp`Ojq+?i(}XJe*>XpVUN)Fi!7JeY7dC(@m%+ET zuaU^!b9W~V-E#x`o}fY3-S>1kfZ8}|;z-C6w8(zc{{Z5R%LQ9yA-lb;3Y)FxO3SR3 zlP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