MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / load_rejects_wrong_magic

Function load_rejects_wrong_magic

native/shared/src/sdf_cache.rs:262–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

260
261 #[test]
262 fn load_rejects_wrong_magic() {
263 let Some(dir) = cache_dir() else { return; };
264 let _ = fs::create_dir_all(&dir);
265 let h = MeshHash(0xbad_0_bad_1);
266 let p = dir.join(h.to_filename());
267 // Hand-write a file with the wrong magic.
268 let mut bad = vec![0u8; 16 + VOXEL_BYTES];
269 bad[..6].copy_from_slice(b"NOTBLM");
270 std::fs::write(&p, &bad).unwrap();
271 assert!(load(h).is_none());
272 let _ = fs::remove_file(p);
273 }
274}

Callers

nothing calls this directly

Calls 3

cache_dirFunction · 0.85
MeshHashClass · 0.85
to_filenameMethod · 0.80

Tested by

no test coverage detected