()
| 226 | |
| 227 | #[test] |
| 228 | fn alloc_exhaustion() { |
| 229 | let mut pool = SlabPool::new(0, 64, 2); |
| 230 | let _id1 = pool.alloc(b"first").unwrap(); |
| 231 | let _id2 = pool.alloc(b"second").unwrap(); |
| 232 | assert!(pool.alloc(b"third").is_none()); // Pool exhausted. |
| 233 | } |
| 234 | |
| 235 | #[test] |
| 236 | fn free_and_reuse() { |