mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-27 08:28:49 +01:00
Previously, in each of our fuzz tests we had a dummy test which had a hard-coded hex string which it passed into the fuzz target so that when a failing test case was found, its hex could be copied into the test and you could run cargo test to analyze the failure. However, this was somewhat unwieldy as converting large tests back and forth between hex and raw files is quite annoying. Instead, we replace each of those tests with a test in each target that looks for files in fuzz/test_cases and runs each file it finds. Since we're editing every bin target anyway, we also automate adding no_main to libfuzzer builds with #![cfg_attr].
16 lines
460 B
Rust
16 lines
460 B
Rust
// 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.
|
|
|
|
use lightning::ln::msgs;
|
|
|
|
use msg_targets::utils::VecWriter;
|
|
|
|
#[inline]
|
|
pub fn do_test(data: &[u8]) {
|
|
test_msg!(msgs::FundingLocked, data);
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn msg_funding_locked_run(data: *const u8, datalen: usize) {
|
|
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
|
}
|