Use workspaces to separate crates
[rust-lightning] / lightning / fuzz / fuzz_targets / msg_targets / msg_onion_hop_data_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
8 mod utils;
9 use utils::VecWriter;
10
11 #[inline]
12 pub fn do_test(data: &[u8]) {
13         test_msg_hole!(msgs::OnionHopData, data, 1+8+8+4, 12);
14 }
15
16 #[cfg(feature = "afl")]
17 #[macro_use] extern crate afl;
18 #[cfg(feature = "afl")]
19 fn main() {
20         fuzz!(|data| {
21                 do_test(data);
22         });
23 }
24
25 #[cfg(feature = "honggfuzz")]
26 #[macro_use] extern crate honggfuzz;
27 #[cfg(feature = "honggfuzz")]
28 fn main() {
29         loop {
30                 fuzz!(|data| {
31                         do_test(data);
32                 });
33         }
34 }
35
36 extern crate hex;
37 #[cfg(test)]
38 mod tests {
39         #[test]
40         fn duplicate_crash() {
41                 super::do_test(&::hex::decode("00").unwrap());
42         }
43 }