mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 18:32:42 +00:00
Add simple fuzz tests for hashing and boolean-bitfield
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#![no_main]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
extern crate boolean_bitfield;
|
||||
|
||||
use boolean_bitfield::BooleanBitfield;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let _result = BooleanBitfield::from_bytes(data);
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
#![no_main]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
extern crate boolean_bitfield;
|
||||
extern crate ssz;
|
||||
|
||||
use boolean_bitfield::BooleanBitfield;
|
||||
use ssz::{Decodable, DecodeError};
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let result: Result<(BooleanBitfield, usize), DecodeError> = <_>::ssz_decode(data, 0);
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
#![no_main]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
extern crate boolean_bitfield;
|
||||
extern crate ssz;
|
||||
|
||||
use boolean_bitfield::BooleanBitfield;
|
||||
use ssz::SszStream;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let bitfield = BooleanBitfield::from_bytes(data);
|
||||
let mut ssz = SszStream::new();
|
||||
ssz.append(&bitfield);
|
||||
});
|
||||
Reference in New Issue
Block a user