MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / fuzz_all_single_byte_sequences

Function fuzz_all_single_byte_sequences

nodedb-query/src/msgpack_scan/reader.rs:705–719  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

703 /// panic — they must return `None` or a valid result.
704 #[test]
705 fn fuzz_all_single_byte_sequences() {
706 for byte in 0u8..=255 {
707 let buf = [byte];
708 // None of these must panic
709 let _ = skip_value(&buf, 0);
710 let _ = read_f64(&buf, 0);
711 let _ = read_i64(&buf, 0);
712 let _ = read_str(&buf, 0);
713 let _ = read_bool(&buf, 0);
714 let _ = read_null(&buf, 0);
715 let _ = map_header(&buf, 0);
716 let _ = array_header(&buf, 0);
717 let _ = read_value(&buf, 0);
718 }
719 }
720
721 /// Feed two-byte patterns to cover tag + partial payload (truncated).
722 #[test]

Callers

nothing calls this directly

Calls 9

skip_valueFunction · 0.85
read_i64Function · 0.85
read_boolFunction · 0.85
read_nullFunction · 0.85
map_headerFunction · 0.85
array_headerFunction · 0.85
read_f64Function · 0.70
read_strFunction · 0.70
read_valueFunction · 0.70

Tested by

no test coverage detected