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

Function golden_header_layout

nodedb-spatial/src/persist.rs:406–416  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404
405 #[test]
406 fn golden_header_layout() {
407 let mut tree = RTree::new();
408 tree.insert(make_entry(1, 10.0, 20.0));
409 let bytes = tree.checkpoint_to_bytes(None).unwrap();
410 // Magic at bytes[0..6].
411 assert_eq!(&bytes[0..6], b"RKSPT\0");
412 // Version byte at bytes[6].
413 assert_eq!(bytes[6], super::RTREE_FORMAT_VERSION);
414 // rkyv payload follows immediately.
415 assert!(bytes.len() > 7);
416 }
417
418 #[test]
419 fn version_mismatch_returns_error() {

Callers

nothing calls this directly

Calls 3

make_entryFunction · 0.70
insertMethod · 0.45
checkpoint_to_bytesMethod · 0.45

Tested by

no test coverage detected