Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
1#![no_main] 2 3// use jetstream::exports::Did; 4use ufos::db_types::DbBytes; 5use ufos::store_types::CountsValue; 6use libfuzzer_sys::fuzz_target; 7 8#[cfg(not(target_env = "msvc"))] 9use tikv_jemallocator::Jemalloc; 10 11#[cfg(not(target_env = "msvc"))] 12#[global_allocator] 13static GLOBAL: Jemalloc = Jemalloc; 14 15fuzz_target!(|data: &[u8]| { 16 if let Ok((counts_value, n)) = CountsValue::from_db_bytes(data) { 17 assert!(n <= data.len()); 18 let serialized = counts_value.to_db_bytes().unwrap(); 19 assert_eq!(serialized.len(), n); 20 let (and_back, n_again) = CountsValue::from_db_bytes(&serialized).unwrap(); 21 assert_eq!(n_again, n); 22 assert_eq!(and_back.counts(), counts_value.counts()); 23 assert_eq!(and_back.dids().estimate(), counts_value.dids().estimate()); 24 } 25});