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

Function store_then_load_roundtrips

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

Source from the content-addressed store, hash-verified

232
233 #[test]
234 fn store_then_load_roundtrips() {
235 // Skip when the env doesn't expose a cache dir (CI sandbox can do this).
236 let Some(_) = cache_dir() else { return; };
237 // Use a hash unlikely to collide with anything else's tests.
238 let h = MeshHash(0xfeed_cafe_dead_beef);
239 let bytes: Vec<u8> = (0..VOXEL_BYTES).map(|i| (i * 7 + 13) as u8).collect();
240 store(h, &bytes).expect("store");
241 let got = load(h).expect("load hit");
242 assert_eq!(got, bytes);
243 // Cleanup so the test is repeatable.
244 if let Some(p) = cache_path(h) { let _ = fs::remove_file(p); }
245 }
246
247 #[test]
248 fn load_miss_returns_none() {

Callers

nothing calls this directly

Calls 5

cache_dirFunction · 0.85
MeshHashClass · 0.85
cache_pathFunction · 0.85
storeFunction · 0.70
loadFunction · 0.70

Tested by

no test coverage detected