rust-lightning/fuzz/fuzz_targets/msg_targets/msg_target_template.txt

47 lines
843 B
Text
Raw Normal View History

// This file is auto-generated by gen_target.sh based on msg_target_template.txt
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
2018-05-13 05:09:46 +09:00
extern crate lightning;
use lightning::ln::msgs;
use lightning::util::reset_rng_state;
use lightning::ln::msgs::{MsgEncodable, MsgDecodable};
mod utils;
#[inline]
pub fn do_test(data: &[u8]) {
reset_rng_state();
test_msg!(msgs::MSG_TARGET, data);
2018-05-13 05:09:46 +09:00
}
#[cfg(feature = "afl")]
#[macro_use] extern crate afl;
2018-05-13 05:09:46 +09:00
#[cfg(feature = "afl")]
fn main() {
fuzz!(|data| {
do_test(data);
2018-05-13 05:09:46 +09:00
});
}
#[cfg(feature = "honggfuzz")]
#[macro_use] extern crate honggfuzz;
#[cfg(feature = "honggfuzz")]
fn main() {
loop {
fuzz!(|data| {
do_test(data);
});
}
}
extern crate hex;
2018-05-13 05:09:46 +09:00
#[cfg(test)]
mod tests {
#[test]
fn duplicate_crash() {
super::do_test(&::hex::decode("00").unwrap());
2018-05-13 05:09:46 +09:00
}
}