From d6b0aca7dd78a99f3167646b67849dce632aea46 Mon Sep 17 00:00:00 2001 From: zseri Date: Sat, 25 Dec 2021 06:12:08 +0100 Subject: chore(zseri/store-ref-scanner): use tailored fuzz input Change-Id: Ib061154c2329432469e8f7bef4598402a56bd0c3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4606 Reviewed-by: zseri Tested-by: BuildkiteCI --- .../store-ref-scanner/fuzz/fuzz_targets/hbm-roundtrip.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'users/zseri/store-ref-scanner/fuzz/fuzz_targets') diff --git a/users/zseri/store-ref-scanner/fuzz/fuzz_targets/hbm-roundtrip.rs b/users/zseri/store-ref-scanner/fuzz/fuzz_targets/hbm-roundtrip.rs index 0738da68b77d..9e21a7738a38 100644 --- a/users/zseri/store-ref-scanner/fuzz/fuzz_targets/hbm-roundtrip.rs +++ b/users/zseri/store-ref-scanner/fuzz/fuzz_targets/hbm-roundtrip.rs @@ -1,13 +1,10 @@ #![no_main] use libfuzzer_sys::fuzz_target; -fuzz_target!(|data: &[u8]| { - use core::convert::TryInto; +fuzz_target!(|data: [u8; 16]| { use store_ref_scanner::HalfBytesMask; - for i in data.chunks_exact(16) { - let a = HalfBytesMask(i.try_into().unwrap()); - let b = a.into_expanded(); - let c = HalfBytesMask::from_expanded(b); - assert_eq!(a, c); - } + let a = HalfBytesMask(data); + let b = a.into_expanded(); + let c = HalfBytesMask::from_expanded(b); + assert_eq!(a, c); }); -- cgit 1.4.1