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

Function header_rejects_bad_crc

nodedb-array/src/segment/format/header.rs:124–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123 #[test]
124 fn header_rejects_bad_crc() {
125 let h = SegmentHeader::new(42);
126 let mut buf = Vec::new();
127 h.encode_to(&mut buf);
128 buf[20] ^= 0xFF;
129 assert!(SegmentHeader::decode(&buf).is_err());
130 }
131
132 #[test]
133 fn header_rejects_truncated() {

Callers

nothing calls this directly

Calls 1

encode_toMethod · 0.45

Tested by

no test coverage detected