Skip to content

Commit

Permalink
zig: rework fuzzing api
Browse files Browse the repository at this point in the history
  • Loading branch information
Organ1sm committed Sep 20, 2024
1 parent da00882 commit 6c4e218
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/aro/Tokenizer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .{
Expand Down

0 comments on commit 6c4e218

Please sign in to comment.