Lines Matching refs:table

445     let mut table = ResourceTable::new();  in test_free_list()  localVariable
447 let x = table.push(()).unwrap(); in test_free_list()
450 let y = table.push(()).unwrap(); in test_free_list()
454 table.delete_maybe_debug(x, false).unwrap(); in test_free_list()
455 let x = table.push(()).unwrap(); in test_free_list()
459 table.delete_maybe_debug(x, false).unwrap(); in test_free_list()
460 table.delete_maybe_debug(y, false).unwrap(); in test_free_list()
462 let y = table.push(()).unwrap(); in test_free_list()
465 let x = table.push(()).unwrap(); in test_free_list()
469 let x = table.push(()).unwrap(); in test_free_list()
475 let mut table = ResourceTable::new(); in test_max_capacity() localVariable
476 assert_eq!(table.max_capacity(), DEFAULT_MAX_CAPACITY); in test_max_capacity()
478 table.set_max_capacity(0); in test_max_capacity()
479 assert_eq!(table.max_capacity(), 0); in test_max_capacity()
480 assert!(table.push(()).is_err()); in test_max_capacity()
482 table.set_max_capacity(1); in test_max_capacity()
483 assert_eq!(table.max_capacity(), 1); in test_max_capacity()
484 let x = table.push(()).unwrap(); in test_max_capacity()
485 assert!(table.push(()).is_err()); in test_max_capacity()
487 table.set_max_capacity(0); in test_max_capacity()
488 assert!(table.push(()).is_err()); in test_max_capacity()
489 table.delete(x).unwrap(); in test_max_capacity()
490 let x = table.push(()).unwrap(); in test_max_capacity()
491 table.delete(x).unwrap(); in test_max_capacity()
493 table.set_max_capacity(10); in test_max_capacity()
495 let handles = (0..10).map(|_| table.push(()).unwrap()).collect::<Vec<_>>(); in test_max_capacity()
496 assert!(table.push(()).is_err()); in test_max_capacity()
498 table.delete(handle).unwrap(); in test_max_capacity()
501 table.push(()).unwrap(); in test_max_capacity()