Thread fuzz test cases
[rust-lightning] / fuzz / src / msg_targets / msg_pong.rs
index c8fc4c59d4a6db97cc1592f43df6ce2a167ee4ef..2fd1c3a8511b080d9757125021631f173a57fed5 100644 (file)
@@ -4,21 +4,15 @@
 use lightning::ln::msgs;
 
 use msg_targets::utils::VecWriter;
+use utils::test_logger;
 
 #[inline]
-pub fn do_test(data: &[u8]) {
+pub fn msg_pong_test<Out: test_logger::Output>(data: &[u8], _out: Out) {
        test_msg_simple!(msgs::Pong, data);
 }
 
 #[no_mangle]
 pub extern "C" fn msg_pong_run(data: *const u8, datalen: usize) {
-       do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
-}
-
-#[cfg(test)]
-mod tests {
-       #[test]
-       fn duplicate_crash() {
-               super::do_test(&::hex::decode("00").unwrap());
-       }
+       let data = unsafe { std::slice::from_raw_parts(data, datalen) };
+       test_msg_simple!(msgs::Pong, data);
 }