()
| 478 | |
| 479 | #[test] |
| 480 | fn test_buffer_cleanup() { |
| 481 | let config = BufferPoolConfig { |
| 482 | cleanup_interval: Duration::from_millis(50), |
| 483 | ..Default::default() |
| 484 | }; |
| 485 | let pool = BufferPool::with_config(config); |
| 486 | |
| 487 | // Add some buffers |
| 488 | { |
| 489 | let _b1 = pool.get_buffer(); |
| 490 | let _b2 = pool.get_buffer(); |
| 491 | } |
| 492 | |
| 493 | // Wait for cleanup interval |
| 494 | thread::sleep(Duration::from_millis(100)); |
| 495 | |
| 496 | // Force cleanup |
| 497 | pool.cleanup(); |
| 498 | |
| 499 | let stats = pool.get_stats(); |
| 500 | assert!(stats.last_cleanup.is_some()); |
| 501 | } |
| 502 | |
| 503 | #[test] |
| 504 | fn test_pooled_bytes_mut_operations() { |
nothing calls this directly
no test coverage detected