1 // This file is auto-generated by gen_target.sh based on target_template.txt
2 // To modify it, modify target_template.txt and run gen_target.sh instead.
4 #![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
6 extern crate lightning_fuzz;
7 use lightning_fuzz::msg_targets::msg_open_channel::*;
12 #[cfg(feature = "afl")]
13 #[macro_use] extern crate afl;
14 #[cfg(feature = "afl")]
17 msg_open_channel_run(data.as_ptr(), data.len());
21 #[cfg(feature = "honggfuzz")]
22 #[macro_use] extern crate honggfuzz;
23 #[cfg(feature = "honggfuzz")]
27 msg_open_channel_run(data.as_ptr(), data.len());
32 #[cfg(feature = "libfuzzer_fuzz")]
33 #[macro_use] extern crate libfuzzer_sys;
34 #[cfg(feature = "libfuzzer_fuzz")]
35 fuzz_target!(|data: &[u8]| {
36 msg_open_channel_run(data.as_ptr(), data.len());
39 #[cfg(feature = "stdin_fuzz")]
41 let mut data = Vec::with_capacity(8192);
42 std::io::stdin().read_to_end(&mut data).unwrap();
43 msg_open_channel_run(data.as_ptr(), data.len());
48 let mut data: Vec<u8> = vec![0];
49 msg_open_channel_run(data.as_ptr(), data.len());
50 if let Ok(tests) = fs::read_dir("test_cases/msg_open_channel") {
53 let path = test.unwrap().path();
54 println!("Running test {}...", path.file_name().unwrap().to_str().unwrap());
55 fs::File::open(path).unwrap().read_to_end(&mut data).unwrap();
56 msg_open_channel_run(data.as_ptr(), data.len());