diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-04 12:15:02 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2025-01-04 12:15:02 +0100 |
commit | fd0cc0b063d02a56b6791f6185bb9c2180b28d47 (patch) | |
tree | 740ce11e32312ee96925b122072b93b2b816dc32 | |
parent | start fuzzing (diff) | |
download | c-hashtable-fd0cc0b063d02a56b6791f6185bb9c2180b28d47.tar.gz c-hashtable-fd0cc0b063d02a56b6791f6185bb9c2180b28d47.tar.bz2 c-hashtable-fd0cc0b063d02a56b6791f6185bb9c2180b28d47.zip |
variable ht capacity in fuzzing
-rw-r--r-- | src/main.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index 45bdf24..5d74277 100644 --- a/src/main.zig +++ b/src/main.zig @@ -46,10 +46,10 @@ test "fuzzing" { try std.testing.fuzz(struct { pub fn func(source: []const u8) !void { if (source.len == 0) return; - std.debug.print("source: {s}", .{source}); - var ht = hashtable.hashtable_init(8); + const capacity: u8 = if (source[0] == 0) 1 else source[0]; + var ht = hashtable.hashtable_init(capacity); defer _ = hashtable.hashtable_deinit(&ht); - var i: usize = 0; + var i: usize = 1; while (i + 2 < source.len) : (i += 2) { const data: i32 = 4; const operation: u8 = source[i]; |