()
| 216 | |
| 217 | #[test] |
| 218 | fn alloc_and_read() { |
| 219 | let mut pool = SlabPool::new(0, 1024, 4); |
| 220 | let data = b"hello slab allocator"; |
| 221 | let id = pool.alloc(data).unwrap(); |
| 222 | assert_eq!(id.core_id, 0); |
| 223 | assert_eq!(id.len, data.len() as u32); |
| 224 | assert_eq!(pool.read(id), data); |
| 225 | } |
| 226 | |
| 227 | #[test] |
| 228 | fn alloc_exhaustion() { |