()
| 438 | |
| 439 | #[test] |
| 440 | fn test_buffer_pool_size_limit() { |
| 441 | let config = BufferPoolConfig { |
| 442 | max_pool_size: 2, |
| 443 | ..Default::default() |
| 444 | }; |
| 445 | let pool = BufferPool::with_config(config); |
| 446 | |
| 447 | // Allocate more buffers than pool size |
| 448 | { |
| 449 | let _b1 = pool.get_buffer(); |
| 450 | let _b2 = pool.get_buffer(); |
| 451 | let _b3 = pool.get_buffer(); |
| 452 | } // All buffers returned |
| 453 | |
| 454 | let stats = pool.get_stats(); |
| 455 | assert_eq!(stats.current_pool_size, 2); // Only 2 should be kept |
| 456 | assert_eq!(stats.buffers_discarded, 1); // 1 should be discarded |
| 457 | } |
| 458 | |
| 459 | #[test] |
| 460 | fn test_buffer_capacity_limit() { |
nothing calls this directly
no test coverage detected