1 // This file is auto-generated by gen_target.sh based on msg_target_template.txt
2 // To modify it, modify msg_target_template.txt and run gen_target.sh instead.
4 extern crate lightning;
6 use lightning::ln::msgs;
7 use lightning::util::reset_rng_state;
9 use lightning::ln::msgs::{MsgEncodable, MsgDecodable};
12 pub fn do_test(data: &[u8]) {
14 if let Ok(msg) = msgs::ErrorMessage::decode(data){
15 let enc = msg.encode();
16 assert_eq!(&data[0..32], &enc[0..32]);
17 assert_eq!(&data[34..enc.len()], &enc[34..]);
21 #[cfg(feature = "afl")]
22 #[macro_use] extern crate afl;
23 #[cfg(feature = "afl")]
30 #[cfg(feature = "honggfuzz")]
31 #[macro_use] extern crate honggfuzz;
32 #[cfg(feature = "honggfuzz")]
45 fn duplicate_crash() {
46 super::do_test(&::hex::decode("00").unwrap());