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

Function wrong_magic_rejected

nodedb-wal/src/preamble.rs:171–176  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169
170 #[test]
171 fn wrong_magic_rejected() {
172 let p = SegmentPreamble::new_wal([0u8; 4]);
173 let bytes = p.to_bytes();
174 // Reading a WAL preamble as a SEG preamble must fail.
175 assert!(SegmentPreamble::from_bytes(&bytes, &SEG_PREAMBLE_MAGIC).is_err());
176 }
177
178 #[test]
179 fn unsupported_version_rejected() {

Callers

nothing calls this directly

Calls 1

to_bytesMethod · 0.45

Tested by

no test coverage detected