6a2b6ac3a7dfa7610f740676eac106c4ae82a320
[rust-lightning] / fuzz / fuzz_targets / msg_targets / msg_funding_signed_target.rs
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.
3
4 extern crate lightning;
5
6 use lightning::ln::msgs;
7 use lightning::util::reset_rng_state;
8
9 use lightning::ln::msgs::{MsgEncodable, MsgDecodable};
10
11 mod utils;
12
13 #[inline]
14 pub fn do_test(data: &[u8]) {
15         reset_rng_state();
16         test_msg!(msgs::FundingSigned, data);
17 }
18
19 #[cfg(feature = "afl")]
20 #[macro_use] extern crate afl;
21 #[cfg(feature = "afl")]
22 fn main() {
23         fuzz!(|data| {
24                 do_test(data);
25         });
26 }
27
28 #[cfg(feature = "honggfuzz")]
29 #[macro_use] extern crate honggfuzz;
30 #[cfg(feature = "honggfuzz")]
31 fn main() {
32         loop {
33                 fuzz!(|data| {
34                         do_test(data);
35                 });
36         }
37 }
38
39 extern crate hex;
40 #[cfg(test)]
41 mod tests {
42         #[test]
43         fn duplicate_crash() {
44                 super::do_test(&::hex::decode("00").unwrap());
45         }
46 }