From 6c4e218cd7b47246057d98c8ea3276548559da73 Mon Sep 17 00:00:00 2001 From: Organ1sm Date: Fri, 20 Sep 2024 15:35:39 +0800 Subject: [PATCH] zig: rework fuzzing api related https://github.com/ziglang/zig/pull/21370 --- src/aro/Tokenizer.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/aro/Tokenizer.zig b/src/aro/Tokenizer.zig index f703940f..7ab33103 100644 --- a/src/aro/Tokenizer.zig +++ b/src/aro/Tokenizer.zig @@ -2151,12 +2151,13 @@ test "C23 keywords" { } test "Tokenizer fuzz test" { + return std.testing.fuzz(testTokenizerFuzz, .{}); +} + +fn testTokenizerFuzz(input_bytes: []const u8) anyerror!void { var comp = Compilation.init(std.testing.allocator, std.fs.cwd()); defer comp.deinit(); - const input_bytes = std.testing.fuzzInput(.{}); - if (input_bytes.len == 0) return; - const source = try comp.addSourceFromBuffer("fuzz.c", input_bytes); var tokenizer: Tokenizer = .{